Is "auto logout" possible?
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Is "auto logout" possible?
I've got a single computer with multiple users that I can't seem to (reliably) teach them to logout after they're done with the computer. When the next user comes to the computer, they just select "Switch User" and then I'm left with up to 3 people being logged in on top of one another.
Is there a way I can have the system log them out after so many minutes of inactivity?
Thank you for your help.
Chrisbo
Is there a way I can have the system log them out after so many minutes of inactivity?
Thank you for your help.
Chrisbo
Re: Is "auto logout" possible?
I know how to log out automatically from the command line, but from a GUI was harder - to be honest I don't know
Re: Is "auto logout" possible?
Unfortunately most of the functionality to enable this action will be at the command line level..
--I can't think of any GUI application that does it
http://blogs.techrepublic.com.com/security/?p=285
--but in windows or Linux, the process is similar enough..
Power management can lock the user, but other options require more manipulation
You will have to do some editing, but you could control their (users) login times
http://www.debian-administration.org/articles/227
http://skindley.wordpress.com/2006/12/1 ... s-by-time/
So the message might be:
http://ubuntuguide.net/make-programappl ... duled-time
Ubuntu 9.04 (Mint 7) possibilities..
http://ubuntuforums.org/showthread.php?t=355630
http://bloggerdigest.blogspot.com/2006/ ... e-few.html
http://www.cyberciti.biz/tips/howto-lin ... users.html
--I can't think of any GUI application that does it
http://blogs.techrepublic.com.com/security/?p=285
--but in windows or Linux, the process is similar enough..
Power management can lock the user, but other options require more manipulation
You will have to do some editing, but you could control their (users) login times
http://www.debian-administration.org/articles/227
http://skindley.wordpress.com/2006/12/1 ... s-by-time/
So the message might be:
- If you don't logout when finished, you will be logged out by the system
- These are your login times to use the computer
- If you are able to manage logging off when finished, the system logout will no longer apply to you
http://ubuntuguide.net/make-programappl ... duled-time
Ubuntu 9.04 (Mint 7) possibilities..
http://ubuntuforums.org/showthread.php?t=355630
http://bloggerdigest.blogspot.com/2006/ ... e-few.html
http://www.cyberciti.biz/tips/howto-lin ... users.html
Re: Is "auto logout" possible?
DrHu,
Thank you very much for the information. I'll start on it as soon as I get back to work, and let you know how it goes!
Chrisbo
Thank you very much for the information. I'll start on it as soon as I get back to work, and let you know how it goes!
Chrisbo
Re: Is "auto logout" possible?
I guess I had a bit more time this morning to look into DrHu's suggestions. It appears that for most of these links, it involves restricting login times then logging out the users. I have no need (yet) to restrict time on the computer, and am just looking for an auto logout after idle. I have found many requests for this type of functionality and it may be worth adding to the distribution at some point.
I found a package called "autolog" but I'm not sure that fits my needs.
I'm trying to wrap my head around "why-you're-editing-what-you're-editing" and I think I'll be able to make it fit my needs, however, I'm still pursuing the issue and will come back here and post what I find.
Chrisbo
I found a package called "autolog" but I'm not sure that fits my needs.
I'm trying to wrap my head around "why-you're-editing-what-you're-editing" and I think I'll be able to make it fit my needs, however, I'm still pursuing the issue and will come back here and post what I find.
Chrisbo
Re: Is "auto logout" possible?
OK, it was in this linkChrisbo wrote:I found a package called "autolog" but I'm not sure that fits my needs.
http://ubuntuforums.org/showthread.php?t=355630
http://unixsystems.blogspot.com/2007/10 ... ut-on.html
- To make modifications apply to all users on the system, specify the TMOUT variable in /etc/ profile.
- Howto
http://pank.org/blog/archives/000871.html
- For shells that read /etc/profile (like bash, ksh, sh) append:
TMOUT=N
export TMOUT
(In Debian you can get away by putting TMOUT=N in /etc/environment).
If you use csh, tcsh, or any in the *csh family, then
edit /etc/csh.cshrc and add:
set autologout = 15
http://hacktux.com/disable/auto/logout
- Find that your shell is logging you out after a certain period of inactivity? You can tweak the number of seconds before the logout, or disable auto logout completely.
Re: Is "auto logout" possible?
Sorry I'm finally getting around to this, but I've been away for a while from this system. Anyway, after searching through my computer, I've found the "profile" file in /etc and this is what it has in it:
--------------------
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='\u@\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
umask 022
---------------------
given this info, where do I put the TMOUT lines?
Thanks!
Chrisbo
--------------------
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='\u@\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
umask 022
---------------------
given this info, where do I put the TMOUT lines?
Thanks!
Chrisbo
Re: Is "auto logout" possible?
I don't think it matters as long as you don't get entangled in somethinggiven this info, where do I put the TMOUT lines?
Put them at the very end
Re: Is "auto logout" possible?
Okay, I'll give that a try as soon as I try this. I guess I missed this line from DrHu's post on 22 NOV:
Thanks again and I'll post back with the results.
Cheers,
Chrisbo
So, I'll edit that file (which has only one line of code - a PATH statement - and see what happens.(In Debian you can get away by putting TMOUT=N in /etc/environment)
Thanks again and I'll post back with the results.
Cheers,
Chrisbo
Re: Is "auto logout" possible?
I tried placing the "TMOUT=300" (which is only a test value) in both the /etc/profile and /etc/environment files - only one at a time - but neither of these worked.
I'm pretty much at a loss after this.
Does anyone else have a suggestion?
Chrisbo
I'm pretty much at a loss after this.
Does anyone else have a suggestion?
Chrisbo
Re: Is "auto logout" possible?
http://hacktux.com/disable/auto/logout
http://www.youtube.com/watch?v=sAFEbImxUfw
It logs out the shell, so if you had a terminal open and export tmout=10, that terminal would close after 10secs.
Is autologout possible ?..
http://www.cyberciti.biz/tips/increase- ... nsole.html
https://blueprints.launchpad.net/ubuntu ... autologout
http://www.linuxforums.org/forum/redhat ... gnome.html
http://www.youtube.com/watch?v=sAFEbImxUfw
It logs out the shell, so if you had a terminal open and export tmout=10, that terminal would close after 10secs.
Is autologout possible ?..
http://www.cyberciti.biz/tips/increase- ... nsole.html
https://blueprints.launchpad.net/ubuntu ... autologout
http://www.linuxforums.org/forum/redhat ... gnome.html
- Some suggest setting a screen-saver timer, start screen-saver after a certain time, also set a password for it for that user (different from the user), so that they do not know the screen-saver password, of course they might be able to override that, if they start practicing with the terminal or discover the password
- They could reboot and login again
They might be able to crash the desktop (ctrl-alt-backspace)
Re: Is "auto logout" possible?
Okay, no luck with those ideas, but let's attack this from another angle. I've been watching how people actually switch users and I see that they use the "Switch User" button on the LOGOUT dialog box instead of clicking on the logout button.
Is there a way to remove the "Switch User" button? That way, they'll have no choice but to logout the previous user? My users aren't computer-savvy enough to figure out how to bypass this (though that may come back to haunt me) and it should solve my problem.
Whaddya think?
Chrisbo
Is there a way to remove the "Switch User" button? That way, they'll have no choice but to logout the previous user? My users aren't computer-savvy enough to figure out how to bypass this (though that may come back to haunt me) and it should solve my problem.
Whaddya think?
Chrisbo
Re: Is "auto logout" possible?
If you have Helena right click the menu button > Preferences > System tab and you can disable the log out option, but that's the opposite to what you want, or?
Easy to restore but you say they are not computer savvy
Easy to restore but you say they are not computer savvy
Re: Is "auto logout" possible?
sorry to dig up an old thread but this isn't solved afaik.
gnome-session-save --logout
or
gnome-session-save --force-logout
are the commands you want.. (for mint with gnome obviously)
i'm trying to work out how to run them automatically after x seconds of idle.. using crontab -e doesn't seem to work (works on its own, but not from cron?). must be possible!
gnome-session-save --logout
or
gnome-session-save --force-logout
are the commands you want.. (for mint with gnome obviously)
i'm trying to work out how to run them automatically after x seconds of idle.. using crontab -e doesn't seem to work (works on its own, but not from cron?). must be possible!
- Pilosopong Tasyo
- Level 6
- Posts: 1432
- Joined: Mon Jun 22, 2009 3:26 am
- Location: Philippines
Re: Is "auto logout" possible?
How is the command being triggered? As part of a script? As an entry to the cron table itself? Try one of these:Smiff2 wrote:using crontab -e doesn't seem to work (works on its own, but not from cron?).
Code: Select all
/usr/bin/gnome-session-save...
Code: Select all
DISPLAY=:0 gnome-session-save...
Code: Select all
DISPLAY=:0 /usr/bin/gnome-session-save...
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
Re: Is "auto logout" possible?
i tried both (calling a script from crontab, putting command in crontab)
neither work
adding DISPLAY:=0 stopped script working, probably because its the wrong display number (error opening display..)
seems like cron just isn't working, any ideas how to debug that
update: checked logs, cron is working, this is the "grandchild failed EXIT status 1" error and i can't find a solution right now :/
btw, --logout-display is perfect as i think it waits 60s then logs out if user doesn't cancel.. i.e. could be run from cron once a night for each user and would do what i want
or better, how to call a script on user idle, like TMOUT, but that works for gui sessions ?
thanks!
neither work
adding DISPLAY:=0 stopped script working, probably because its the wrong display number (error opening display..)
seems like cron just isn't working, any ideas how to debug that
update: checked logs, cron is working, this is the "grandchild failed EXIT status 1" error and i can't find a solution right now :/
btw, --logout-display is perfect as i think it waits 60s then logs out if user doesn't cancel.. i.e. could be run from cron once a night for each user and would do what i want
or better, how to call a script on user idle, like TMOUT, but that works for gui sessions ?
thanks!
- Pilosopong Tasyo
- Level 6
- Posts: 1432
- Joined: Mon Jun 22, 2009 3:26 am
- Location: Philippines
Re: Is "auto logout" possible?
Well, a few ideas come to mind. Assuming it has been configured for a given user, you can use:Smiff2 wrote:...or better, how to call a script on user idle...
Code: Select all
gnome-screensaver-command -q
Code: Select all
gnome-screensaver-command -t
Code: Select all
pkill -SIGKILL -u <username>
You'll still need to set cron to trigger the script on a regular basis, in this case, every minute.
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
Re: Is "auto logout" possible?
just using the gnome-session-save logout would be simplest, if i can get cron to run it.. e..g once a night per user.
i know about pkill, used that when setting up accounts, but don't want to run it routinely, might cause user home corruption.
might be an ubuntu 10.10/mint10 issue? will try on mint11 tomorrow.
i know about pkill, used that when setting up accounts, but don't want to run it routinely, might cause user home corruption.
might be an ubuntu 10.10/mint10 issue? will try on mint11 tomorrow.
Re: Is "auto logout" possible?
nah same error in mint11
any ideas please?
saw this on ubuntu forum
"If it runs manually just fine, but fails from cron, then it's either a malformed crontab line or a missing environment variable in the script."
update:
seems to work in mint11, but not 10!
damn.. or could be that its a different system with different users logged on? how to get current DISPLAY?
Code: Select all
Aug 20 21:14:01 CENTRE CRON[24908]: (username) CMD (/usr/bin/gnome-session-save --logout-display)
Aug 20 21:14:01 CENTRE CRON[24907]: (CRON) error (grandchild #24908 failed with exit status 1)
Aug 20 21:14:01 CENTRE CRON[24907]: (CRON) info (No MTA installed, discarding output)
saw this on ubuntu forum
"If it runs manually just fine, but fails from cron, then it's either a malformed crontab line or a missing environment variable in the script."
update:
Code: Select all
export DISPLAY:=0 && /usr/bin/gnome-session-save --logout-display
damn.. or could be that its a different system with different users logged on? how to get current DISPLAY?
Re: Is "auto logout" possible?
right, i just discovered the "gnome-schedule" package.
use this, set it to X Application, command is gnome-session-save with options as explained above, seems to work fine!
yay.
problems
1) users can disable their own scheduled tasks, but this shouldn't be a big problem with non-technical users for now. i could just hide the menu entry for gnome-schedule if they don't need to schedule their own tasks..
2) crontabs are stored per machine (and per user), so if you have an nfs network you seem to need to configure this for every user for every machine. tedious. i can't seem to get templates to work across users either.
***
the other tip i will add, for OP, is that it seems to help to edit all your major app launchers
e.g. which firefox
sudo nano /usr/bin/firefox
"nice -nX" the exec line, where X is a small positive integer.
this helps keep system responsive with multiple users.. i think.
use this, set it to X Application, command is gnome-session-save with options as explained above, seems to work fine!
yay.
problems
1) users can disable their own scheduled tasks, but this shouldn't be a big problem with non-technical users for now. i could just hide the menu entry for gnome-schedule if they don't need to schedule their own tasks..
2) crontabs are stored per machine (and per user), so if you have an nfs network you seem to need to configure this for every user for every machine. tedious. i can't seem to get templates to work across users either.
***
the other tip i will add, for OP, is that it seems to help to edit all your major app launchers
e.g. which firefox
sudo nano /usr/bin/firefox
"nice -nX" the exec line, where X is a small positive integer.
this helps keep system responsive with multiple users.. i think.