How To Disable User Logon in Linux

Source: Internet
Author: User

During system maintenance, we hope that individual users or all users cannot log on to the system to ensure normal system operation during maintenance. In this case, users are prohibited from logging on.
1. Individual users are prohibited from logging on. For example, you cannot Log On As A lynn user. Passwd-l lynn means to lock the lynn user so that the user cannot log on. Passwd-u lynn unlocks the Locked User lynn, and the user can log on.
2. Modify the shellvi/etc/passwdroot: x: 0: 0: root:/bin/bashbin: x: 1: 1: bin:/sbin/nologindaemon: x: 2: 2: daemon:/sbin/nologinadm: x: 3: 4: adm: /var/adm:/sbin/nologinlp: x: 4: 7: lp:/var/spool/lpd:/sbin/nologinsync: x: 5: 0: sync: /sbin:/bin/syncshutdown: x: 6: 0: shutdown:/sbin/shutdownhalt: x: 7: 0: halt:/sbin/haltmail: x: 8: 12: mail:/var/spool/mail:/sbin/nologinuucp: x: 10: 14: uucp:/var/s Pool/uucp:/sbin/nologinoperator: x: 11: 0: operator:/root:/sbin/nologingames: x: 12: 100: games:/usr/games: /sbin/nologinlynn: x: 500: 500:/home/lynn:/bin/bash changed to: lynn: x: 500: 500:/home/lynn: /sbin/nologin the user cannot log on.
3. All users are prohibited from logging on. Users other than the root user cannot log on to touch/etc/nologin. Author qinggzha

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.