1

I work on Linux servers via SSH (putty) and run "screen" to preserve my sessions so I can attach/detach them at anytime I wish without losing the connectivity/process disruption which is working perfectly fine.

As my team members also have root access to those servers, it is very much possible for them to attach "MY" sessions and can see what I'm doing. Is there anyway I can't allow them to do that? To solve this issue (upto some extent), setting a time-out on my sessions would help a bit. In other words, is it possible to set a timeout on screen session within which I should re-attach (after detaching) the screen session with 12 hours (for eg timeout set to 12 hours) else that screen session should be auto-killed. Any thoughts on tailoring this requirement would be great.

Many thanks!

0

yes that's no problem. You need a setting named TMOUT. It looks like this.

setenv TMOUT 43200

you can chose if how globally it should apply. If you add this to /etc/screenrc, it'll be like this for everyone using screen. If you add this to /root/.screenrc it'll only be for screen sessions started by root. If you add this to ~/.screenrc it'll only be for screen sessions started by you.

Another option that matches what you need: You can also make screen "lock" the session automatically using

idle 900 lockscreen

This will lock it after 15 minutes, and you NEED a password configured for your user to unlock it. Watch out on home-user OS like OSX or Ubuntu which by default as a 'feature' have no root password set. There you must start the session as your (password-possessing) user. (Or log in another time and screen -r -d)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.