|
| |||||||||
| Tags: force logoff, linux script, logoff users |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Linux script to force logoff users
I want to create a Linux script to force logoff users after a fix time say 60 mins. How do i write a script in linux? I have been writing small batch programs in Windows. But i am totally new to linux. Any Help? Thanks in advance... ![]() |
|
#2
| ||||
| ||||
| Re: Linux script to force logoff users
This may help you... A user will log out after one hour and will get a warning when last 5 minutes are remaining... Code: #!/bin/bash hour=1 limit_time=`expr $hour \* 60 - 300` sleep $limit_time echo "5 Minutes More for automatic logoff" sleep 300 logout exit 0 |
|
#3
| |||
| |||
| Re: Linux script to force logoff users
How to i make this text as a script file? How do i run it at startup with run level 5? I have no idea about this. In windows i just use to add this to startup in program files and it would do the trick. Thanks though. |
|
#4
| |||
| |||
| Re: Linux script to force logoff users
Open any text editor and copy the above contents there. Now save this file without any extenstion or with .sh extension. Now save this file to /etc/init.d/ location. Then run : Code: cp logoff.sh /etc/init.d ln -s /etc/init.d/logoff.sh /etc/rc.d/rc5.d/S50logoff.sh ln -s /etc/init.d/logoff.sh /etc/rc.d/rc5.d/K50logoff.sh |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Linux script to force logoff users" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Force logoff malfunctioning | giorgos | Operating Systems | 4 | 26-01-2010 02:29 AM |
| How to force a logoff in a logon script? | John | Windows Server Help | 7 | 31-03-2008 02:54 AM |
| Force Auto Logoff and Logon | ctulumba@gmail.com | Windows Server Help | 0 | 13-02-2008 09:49 PM |
| logoff vbs script | Coreman | Windows Server Help | 1 | 28-04-2007 07:02 AM |
| Force User Logoff | Rob Howard | Active Directory | 5 | 13-12-2004 07:53 PM |