Linux sudo command All In One
Linux sudo command All In One
superuser do => sudo
substitute user => su
substitute user do => su do
# 切到 root 帐号/ superuser => su
$ sudo su
sudo
vs su
sudo is a program for Unix-like computer operating systems that enables users to run programs with the security privileges of another user, by default the superuser. It originally stood for "superuser do
", as that was all it did, and it is its most common usage; however, the official Sudo project page lists it as "su do
". The current Linux manual pages for su
define it as "substitute user
", making the correct meaning of sudo "substitute user, do
", because sudo can run a command as other users as well.
sudo 是一个用于类 Unix 计算机操作系统的程序,它使用户能够以其他用户(默认情况下为超级用户)的安全权限运行程序。它最初代表“超级用户做
”,因为这就是它所做的一切,这是它最常见的用法;但是,Sudo官方项目页面将其列为“su do”。目前 su
的 Linux 手册页将其定义为“替代用户
”,使得 sudo 的正确含义是“替代用户,做
”,因为 sudo 也可以像其他用户一样运行命令。
- sudo 更安全 ✅
- 作用范围不同,
sudo
仅对单次命令有效 vssu
对全局命令有效
switch user
=> su
https://phoenixnap.com/kb/sudo-vs-su-differences
https://phoenixnap.com/kb/linux-sudo-command
https://phoenixnap.com/kb/su-command-linux-examples
docs
$ man sudo | pbcopy
$ man su | pbcopy
https://www.jianshu.com/p/a617691a7f4f
https://superuser.com/questions/105367/command-sudo-su
https://www.unixtutorial.org/sudo-meaning-what-does-sudo-mean/