Linux Logon Only

Source: Internet
Author: User
Linux time-limited logon-Linux Enterprise Application-Linux server application information. The following is a detailed description. Write three shell programs and call at and system maintenance functions:
1. Execute the shell at the specified time and generate a file named nologin under/etc, for example:
Vi/sbin/login. denied
Echo "Login Denied">/etc/nologin
Chmod 700 login. denied
2. Run the shell at the specified time to delete the nologin file under/etc/, for example:
Vi/sbin/login. allowed
If [-f/etc/nologin]; then
Rm/etc/nologin
Fi
Chmod 700 login. allowed
3. Write a shell with a limited time, for example:
Vi/sbin/security
If [-f/sbin/login. denied]; then
At-f/sbin/login. denid 22: 00
Fi
If [-f/sbin/login. allowed]; then
At-f/sbin/login. allowed 8: 00
If
The function of this setting is to disable non-root user logon from to the next day, and the system maintenance status is displayed.
In addition, you also need to restrict the logon terminal of the root user. It is best to set it on the console and in/etc/security/access. conf under RedHat 5.0.
Configuring
-: Root: ALL privileges t console
You can.

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.