Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
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...
  1. #1
    Just 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

  2. #2
    oz
    oz is offline
    forum.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:

    Code:
    touch /etc/nologin
    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:
    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.

  3. #3
    Just 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:

  4. #4
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,099
    You'd need to create a 2nd file in /etc called nologin.allow:

    Code:
    vim /etc/nologin.allow
    ...then add the users you want to be able to login to the file.

    Code:
    username1
    username2
    username3
    Save the file and I think it should work.
    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.

  5. #5
    Just 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

  6. #6
    oz
    oz is offline
    forum.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.

  7. #7
    Just Joined! serverlinux's Avatar
    Join Date
    May 2007
    Location
    Argentina
    Posts
    64
    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

  8. #8
    Just 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.

  9. #9
    Just Joined! serverlinux's Avatar
    Join Date
    May 2007
    Location
    Argentina
    Posts
    64
    Well, that is not a problem, you have to specify something like this in /etc/security/time.conf


    login;*;!youruser;!Al1500-1700

  10. #10
    Just 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.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...