Linux command details-server management

Source: Internet
Author: User
Tags file permissions

1. Management Server Common commands

1. View online users: Who | Grep–v Root

2. Partition usage: df–h

3. View memory Information: free–m

4. View current time: Date

5. Write all events to the message:/bin/date >> Mail.cron

6. Execute the Sending message: (1.) Start mail server:/etc/init.d/sendmail start (2.) Send mail:/bin/mail–s subject users < Mail.cron

7. Timed Execution: Crontab–e

2.VI Editor

1. Set the line number: (1.) Bottom line mode:: Se nu (2.) ~/.VIMC Write set nu//Auto Add line number

2. View package path which VI Rpm–qf/bin/vi

3. Help: Man VI

3. File permissions

1.root user-created folders, how ordinary users create files in this folder

Workaround: Create two users, common group (1.) Groupadd group name (2.) gpassswd-a Zhangsan Group name (3.) to see if Zhangsan is within group: grep Group name/etc/group (4.) Change groups CHGRP Group name directory (5.) To give directory writable permissions: chmod g+w Directory

2. New file Permissions 644, no Execute permissions directory: 755

3. View User Rights Umask

4. SetUID: Normal user executes chmod u+s executable file with Admin user

5. Set the startup Vi/etc/inittab

6. When directory permissions are granted 777, users can only delete files that they have created and cannot delete files created by other users

7. Prevent accidental deletion, do not allow operation chattr +i file name can only be appended: chattr +a file name

8.visudo What's new Zhangsan helen= command to authorize root permissions

9. Sudo–l View all authorizations

10. Administrators authorize ordinary users to manage Apache:

(1.) Authorized User: Visudo Zhangsan helen=/apache/bin/apachectl,/bin/vi/apache/conf/httpd.conf

(2.) Authorized folder for normal users: Chown

11. Complex Permissions Control: ACL

(1.) Mount–o Remount,acl/home

(2.) setfacl-m u:zhangsan:rwx file name

(3.) View permissions: Getfacl file name

Linux command details-server management

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.