Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Ubuntu 16.04 lts desk; Ubuntu 14.04 server
Posts: 366
Rep:
Lubuntu 12.04 screen lock kills ssh session
Friends--
Lubuntu 12.04 fresh install. I login from the computer. I then login via ssh from another computer. When the first session screen locks after X minutes, my ssh session is killed or at least locked. When I go back to the physical machine and login, then I can continue my ssh session. How can I shut off this behavior so my ssh session is not interrupted? But I still want the screen saver/lock to work on this machine when I am accessing it remotely.
Ssh into the machine then start a 'screen' session? (See 'man screen'.) Even if you get thrown out you can ssh back in again and re-connect to your screen session to find none of your work is lost. (Also see 'autossh' for keeping SSH sessions alive.)
Distribution: Ubuntu 16.04 lts desk; Ubuntu 14.04 server
Posts: 366
Original Poster
Rep:
unSpawn--
Thanks!
So is this normal behavior for a host to kill an ssh session when the screensaver kicks in?
I was going to say that I have not had this before, but as I think about it, most of my ssh activity has been to login to headless boxes which are not running X. Or I am in and out quickly such as to run an apt-get upgrade. So maybe this is normal and I have just not seen it.
Distribution: Ubuntu 16.04 lts desk; Ubuntu 14.04 server
Posts: 366
Original Poster
Rep:
unSpawn--
Thanks!
Well it sure seems to be the screen saver: it coincides with that kicking in.
Any ideas on where to look for a workaround, other than the one you gave me (autossh)? I have googled and asked at several forums, but you are the only person to respond! And I thank you for doing so!
I have one Ubuntu LTS but it runs CLI only, no Desktop Environment at all, so no I don't have a clue but I'm willing to think along. Start by finding out what screen saver it runs (probably gnome-screensaver) and look with Gconf-tool (or equivalent) at its scheme, maybe it has some tweaks. If not we'll have to start looking for error messages in /var/log to see what actually kills the session.
Distribution: Ubuntu 16.04 lts desk; Ubuntu 14.04 server
Posts: 366
Original Poster
Rep:
Report
unSpawn--
Did as you suggested and checked out both dconf-editor and gconf-editor but found nothing. So I did tail -f /var/log/syslog and got some errors about network-manager.
Although I had no file called /etc/NetworkManager/nm-system-settings.conf, I created one and put in the line about managed=true, and rebooted. But alas the same problem.
Here is what tail -f shows:
Code:
Feb 5 22:14:41 samba1 NetworkManager[769]: <info> sleep requested (sleeping: no enabled: yes)
Feb 5 22:14:41 samba1 NetworkManager[769]: <info> sleeping or disabling...
Feb 5 22:14:41 samba1 NetworkManager[769]: <info> (eth0): now unmanaged
Feb 5 22:14:41 samba1 NetworkManager[769]: <info> (eth0): device state change: unavailable -> unmanaged (reason 'sleeping') [20 10 37]
Feb 5 22:14:41 samba1 NetworkManager[769]: <info> (eth0): cleaning up...
Feb 5 22:14:41 samba1 NetworkManager[769]: <info> (eth0): taking down device.
Feb 5 22:14:41 samba1 NetworkManager[769]: <info> (eth1): now unmanaged
Feb 5 22:14:41 samba1 NetworkManager[769]: <info> (eth1): device state change: activated -> unmanaged (reason 'sleeping') [100 10 37]
Feb 5 22:14:41 samba1 NetworkManager[769]: <info> (eth1): deactivating device (reason 'sleeping') [37]
I'm giving up for tonight, and deleting the file I created, but wonder if you see something useful as a clue there?
I doubt that but lets try something else:
0.) stop the SSH daemon, then start it manually in debug mode: 'sudo /usr/sbin/sshd -ddd 2>&1 | tee /tmp/sshd.log'
1.) connect but run 'ssh -vvv user@host 2>&1 | tee /tmp/ssh.log' instead.
2.) Now wait until the screen saver kicks in, collect both logs and then check those for clues plus your ~/.xsession-error*, /var/log/auth.log, /var/log/Xorg.0.log, /var/log/messages, /var/log/daemon.log and /var/log/*dm/* log files (if they exist and the time stamps match with your ssh logs).
Distribution: Ubuntu 16.04 lts desk; Ubuntu 14.04 server
Posts: 366
Original Poster
Rep:
unSpawn--
Thanks! That is a good suggestion. I will try it when I am not so tired.
Actually I went a step further after I posted the other night and found another file in the same directory which looked like the new name for this nm- file. So I put the entry in there instead, and it still gave me the same errors. So I think you are right about looking in the wrong place.
But I did see that in the gui on the Lubuntu box are power management settings which basically suspend the whole box at X minutes. I am thinking that that is the culprit.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.