xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Linux sudo command All In One

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 也可以像其他用户一样运行命令。

  1. sudo 更安全 ✅
  2. 作用范围不同,sudo 仅对单次命令有效 vs su 对全局命令有效

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

https://askubuntu.com/questions/376199/sudo-su-vs-sudo-i-vs-sudo-bin-bash-when-does-it-matter-which-is-used

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/

image

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2022-12-10 20:19  xgqfrms  阅读(19)  评论(0编辑  收藏  举报