In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Can't understand how to use linux sudo to execute commands as a system administrator? In fact, it is not difficult to solve this problem. Let Xiaobian take you to learn how to solve it together. I hope you will gain a lot after reading this article.
Sudo is a privilege management mechanism that allows an administrator to authorize ordinary users to perform certain actions performed by root without knowing root's password.
Sudo allows an authorized user to run a command in the role of superuser or other user. Of course, what can and cannot be done is dictated by security policy. Sudo supports plug-in architecture security policies and logs input and output. Third parties can develop and publish their own security policies and input/output logging plugins and make them work seamlessly with sudo. The default security policy is documented in the/etc/sudoers file. Security policies may require users to authenticate themselves with passwords. That is, when the user executes the sudo command, the user is required to enter the password of his account. If validation fails, sudo will exit.
Syntax format: sudo [parameter]
Common parameters:
-v Because sudo asks for password on the first execution or if it is not executed within N minutes (N is preset to five), this parameter is reconfirmed, and if it is more than N minutes, it will also ask for password-k forces the user to ask for password on the next execution of sudo.(whether or not it has been more than N minutes)-b background execution of instructions to be executed-pprompt can change the password prompt, where %u is substituted with the user's account name, %h displays the instructions to be executed by the shell specified by the SHELL in the host name-s execution environment variable, or by the shellcommand specified in/etc/passwd as the system administrator (or changed to someone else with-u)
Reference Example
Switch to root:
[root@linuxcool ~]# sudo su
Specify user to execute command:
[root@linuxcool ~]# sudo -u userb ls -l
Execute the previous command with root privileges:
[root@linuxcool ~]# sudo !!
List current permissions:
[root@linuxcool ~]# sudo -l
List the version information of sudo:
[root@linuxcool ~]# sudo -V Thank you for reading this article carefully, I hope Xiaobian share the use of linux sudo command as a system administrator to execute instructions to help everyone, but also hope that everyone more support, pay attention to industry information channels, encounter problems to find, detailed solutions waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.