# login.conf idletimeout not working



## laocius (May 24, 2018)

Hi,

I am trying to configure ssh idle timeout. I know that I could do it with 'set autologout' in rc files. But our users are configured with different shells and the the default shell sh doesn't like 'set autologout'. According to the manual page of login.conf, this can be achieved by setting idletimeout in /etc/login.conf. But it didn't work for me.
I also tried setting 'UseLogin yes' in sshd_config and it didn't work either. 

```
default:\
        :passwd_format=sha512:\
        :copyright=/etc/COPYRIGHT:\
        :welcome=/etc/motd:\
        :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\
        :path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin ~/bin:\
        :nologin=/var/run/nologin:\
        :cputime=unlimited:\
        :datasize=unlimited:\
        :stacksize=unlimited:\
        :memorylocked=64K:\
        :memoryuse=unlimited:\
        :filesize=unlimited:\
        :coredumpsize=unlimited:\
        :openfiles=unlimited:\
        :maxproc=unlimited:\
        :sbsize=unlimited:\
        :vmemoryuse=unlimited:\
        :swapuse=unlimited:\
        :pseudoterminals=unlimited:\
        :kqueues=unlimited:\
        :umtxp=unlimited:\
        :priority=0:\
        :ignoretime@:\
        :umask=022:\
        :idletime=20s:
```

Also I found that if I add something to 'setenv' in /etc/login.conf, it did successfully set the environment variable, which means ssh is actually using /etc/login.conf. But why the 'idletime' parameter doesn't work?


----------



## rigoletto@ (May 24, 2018)

What is the problem of configuring the timeout on sshd_config(5)?

See TCPKeepAlive, ClientAlive*...



laocius said:


> I know that I could do it with 'set autologout' in rc files.



I can't find anything like that on /etc/rc.d/sshd. 



laocius said:


> According to the manual page of login.conf, this can be achieved by setting idletimeout in /etc/login.conf.



What? You are seriously confusing rc.d scripts, shells, system envirolment, and the OpenSSH configuration.

Just to make it clear 'set autologout' on a tcsh(1) shell will logout the user from system (completely). This has absolutely notthing to do with ssh sections.


----------



## ShelLuser (May 24, 2018)

I definitely agree with lebarondemerde , you want ClientAliveInterval for SSH (/etc/sshd_config).


----------

