Results 1 to 10 of 12
I am setting up a new linux system for many users and would like to know how to disable login whilst backup is being run.
Any help much apreciated...
- 12-06-2007 #1Just Joined!
- Join Date
- Dec 2007
- Posts
- 15
new user to suse linux
I am setting up a new linux system for many users and would like to know how to disable login whilst backup is being run.
Any help much apreciated
- 12-06-2007 #2forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,099
Welcome to the forums!
For simply disabling non-root logins, you could create a nologin file in /etc:
Only root users can login after that. Once you are done with your backup, you can remove the file to put things back the way they were:Code:touch /etc/nologin
Code:rm /etc/nologin
oz
→ new members/users: read this first | new member faq
→ no private messages requesting computer support - post them on the forums!
→ please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.
- 12-06-2007 #3Just Joined!
- Join Date
- Dec 2007
- Posts
- 15
thank you for being so prompt
Thank you love a quick response, I am running a suse linux box and cannot log in remotely as root. I would need to exempt my normal login account from the nologin file. Any ideas:
- 12-06-2007 #4forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,099
You'd need to create a 2nd file in /etc called nologin.allow:
...then add the users you want to be able to login to the file.Code:vim /etc/nologin.allow
Save the file and I think it should work.Code:username1 username2 username3
oz
→ new members/users: read this first | new member faq
→ no private messages requesting computer support - post them on the forums!
→ please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.
- 12-06-2007 #5Just Joined!
- Join Date
- Dec 2007
- Posts
- 15
nologin.allow
Hi Ozar
Thank you, did as suggested, but could not login as one of the users in the /etc/nologin.allow file until the /etc/nologin file was removed.
Julie
- 12-06-2007 #6forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,099
Sorry, I'm not sure why it's not working. I just tried it here and it's not working for me, either. I'll do some digging around and try to figure it out.
In the interim, maybe someone else will know why it's not working, or perhaps have a better solution that you can try out.
Edit: While waiting for any ideas to roll in, you might also check your backup utility for options to disable user logins because some tools come with that option built in.Last edited by oz; 12-06-2007 at 06:05 PM.
oz
→ new members/users: read this first | new member faq
→ no private messages requesting computer support - post them on the forums!
→ please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.
- 12-06-2007 #7
Hi, you have to do the following :
Let us know which services you want to disable users to login, if ssh, or terminal.. if it is ssh then you have to edit /etc/pam.d/sshd
Add the following line:
account required pam_nologin.so
And then you do:
touch /etc/nologin
This would disable users, except root from logging in
For more examles see here:
Linux Server Security Secrets and Administration: Disable users from loggin into the server, excep the administrator
- 12-06-2007 #8Just Joined!
- Join Date
- Dec 2007
- Posts
- 15
Thank you, however I work remotely and you cannot log in as root remotely, so need to be able to exempt some users from the login.
- 12-07-2007 #9
Well, that is not a problem, you have to specify something like this in /etc/security/time.conf
login;*;!youruser;!Al1500-1700
- 12-07-2007 #10Just Joined!
- Join Date
- Dec 2007
- Posts
- 15
Thank you
Hi Walter,
Thank you for your response, I need to be able to turn it on and off within a shell as backup is run at various times during the night, depending on whether nightshift etc is running.


Reply With Quote