Linux account and ACL settings

What is ACL: access control list


Order:

mount -o remount: Remount an already mounted file system in a different way. For example, it was originally a unique system, and now it can be mounted with read-write.

    eg:mount -o remount ,acl / (add ACL function to root directory / remount)


ACL setting and viewing:

setfacl -mu: user: permission target file (setfacl -mu: byf: rw test1, which means setting the permission of user byf to rw for the test1 file)

setfacl -mg: user group: permission target file (same as above)

setfacl -mm: permission target file (set mask effective permission on target file)

setfacl -md:[ug]: user or group: permission (add a d table to inherit before u or g, that is, the newly generated files in this directory also inherit the acl settings)

getfacl target file (getfacl test1, view the acl permissions of the target file test1)


env: View the environment parameters of the current account


su -username or su -l username: The full switch user's environment. If you want to execute the root command once, you can use su - -c "command string"

sudo -u username: lets you execute commands as another user


sh -c "multiple command strings, available between command strings; separated"


Firewall ports open:

The configuration file is /etc/sysconfig/iptables

If I want to open port 8080, I can

在:-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

Followed by -A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

After adding and saving, restart the service service iptables restart|start|stop

/sbin/iptables -L -n: View firewall rules



/usr/ local / webserver / nginx / sbin / nginx - s reload             # Reload configuration files / usr / local / webserver / nginx / sbin / nginx - s reopen #Restart             Nginx / usr / local / webserver / nginx / sbin / nginx - s stop               # stop Nginx


alias: set the nickname of the command.eg alias vi=vim means that typing vi is equivalent to typing vim

netstat -anp | grep 80: View the status of port 80

ps -ef | grep "nginx": View processes related to nginx

!2: Execute the second command under history


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325620478&siteId=291194637