在 Linux 系统中,有两个常用的命令用于切换用户身份和执行特权操作,它们分别是 su 和 sudo。虽然它们都可以实现权限提升,但在使用方式、安全性和适用场景等方面存在一些区别。本文将介绍 su 和 sudo 命令的区别,以帮助用户正确选择和使用这两个命令。
之前一直对 su 和 sudo 这两个命令犯迷糊,最近专门搜了这方面的资料,总算是把两者的关系以及用法搞清楚了,这篇文章来系统总结一下。 因为本篇博客中涉及到用户切换,所以我需要提前准备好几个测试用户,方便后续切换。 Linux 中新建用户的命令是 useradd ...
If you’re a new Linux admin, you probably at least know about sudo. Sudo stands for “super user do” and allows standard users to take admin-level actions, such as installing software. Even though most ...
Back in the early days of Linux, things were exponentially more complicated. The distributions were far less mature and required a particular system account to get things done. That account was root - ...
Sudo is a powerful but imperfect Linux tool. These tips can help make using sudo easier and safer. Always use caution when monkeying with sudo. I started using Linux prior to the advent of sudo. Back ...
OK, it looks like you need to employ some extra privilege. In general, you can’t write to a system log file with your user account. Let’s try that again with sudo. The response to the first of the ...