search
HomeOperation and MaintenanceLinux Operation and MaintenanceWhat is the difference between su, sudo and sudo -i?

What is the difference between su, sudo and sudo -i?

The differences between the three are as follows:

(Recommended tutorial: linux tutorial)

sudo: Temporarily switch to super user mode To execute super user privileges, when prompted for a password, the password will be the password of the current user, not the password of the super account. The disadvantage is that every time you execute super user privileges, you must add sudo before the command. The advantage is that you do not need to re-enter the password when using sudo in the current terminal (valid only for the current terminal).

sudo -i: In order to frequently execute certain permissions that only the super user can execute without having to enter a password every time, you can use this command. When prompted for a password, the password will be the password for the current account. no time limit. After executing this command, the prompt changes to "#" instead of "$". When you want to return to a normal account, you can execute "exit" or "logout".

su: Switch to a certain user mode, the password when prompted to enter the password is the password of the account after switching, and the usage is "su account name". If no account is added later, the system defaults to the root account, and the password is also the password of the super account. no time limit. It should be noted that when using su to switch users, you need to bring -i so that you can switch with the environment.

The above is the detailed content of What is the difference between su, sudo and sudo -i?. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:csdn. If there is any infringement, please contact admin@php.cn delete
如何在 Windows 10 或 11 WSL 上安装 Oracle Linux – 子系统如何在 Windows 10 或 11 WSL 上安装 Oracle Linux – 子系统Apr 14, 2023 pm 10:07 PM

在Windows10上安装OracleLinux8或7.5的步骤|11WSL1.启用WSL–Windows子系统Linux我们需要拥有的第一件事是WSL,如果尚未启用它,请启用它。转到搜索框并输入–打开或关闭Windows功能。在选项出现时,单击以打开相同。在打开的窗口中,向下滚动并选择为Linux的Windows子系统提供的框。然后单击确定按钮。之后重新启动系统以应用更改。2.在Windows11或10上下载OracleLinx8或

如何在Windows 11/10中运行SUDO命令如何在Windows 11/10中运行SUDO命令Mar 09, 2024 am 09:50 AM

通过sudo命令,用户可以在提升权限模式下运行命令,而无需切换到超级用户模式。本文将介绍如何在Windows系统中模拟类似于sudo命令的功能。什么是数道司令部?Sudo(“超级用户do”的缩写)是一种命令行工具,允许基于Unix的操作系统(如Linux和MacOS)的用户以提升的权限执行命令,这些权限通常是管理员所拥有的。在Windows11/10中运行SUDO命令然而,随着最新发布的Windows11Insider预览版推出,Windows用户现在也可以体验到这一项功能。这一新功能使用户能够

在Windows 10或11上安装Adminer的步骤在Windows 10或11上安装Adminer的步骤Apr 23, 2023 pm 04:40 PM

在Windows11或10上安装Adminer的步骤在Windows11和10操作系统上都可以按照这些步骤安装Adminer来管理不同的数据库系统。1.在Windows上启用WSL如果您已经启用了WSL,则转到下一步,否则转到Windows开始菜单并键入“打开或关闭Windows功能”,并在其图标出现时将其打开。向下滚动到WindowsSubsystemforLinux,选择它,然后点击OK按钮。WSL安装完成后,会出现一个对话框要求您重新启动系统。2

linux sudo密码是什么linux sudo密码是什么Feb 15, 2023 am 10:34 AM

linux sudo密码是随机的,即每次开机都有一个新的root密码,其设置新密码的方法是:1、在终端输入命令“sudo passwd”,然后输入当前用户的密码,按下“Enter”键;2、重新在终端输入新的密码并确认即可。

什么是 sudo,为什么它如此重要?什么是 sudo,为什么它如此重要?Feb 21, 2024 pm 07:01 PM

sudo(超级用户执行)是Linux和Unix系统中的一个关键命令,允许普通用户以root权限运行特定命令。sudo的功能主要体现在以下几个方面:提供权限控制:sudo通过授权用户以临时方式获取超级用户权限,从而实现了对系统资源和敏感操作的严格控制。普通用户只能在需要时通过sudo获得临时的特权,而不需要一直以超级用户身份登录。提升安全性:通过使用sudo,可以避免在常规操作中使用root账户。使用root账户进行所有操作可能会导致意外的系统损坏,因为任何错误或不小心的操作都将具有完全的权限。而

如何在 Alpine Linux 上启用或禁用防火墙?如何在 Alpine Linux 上启用或禁用防火墙?Feb 21, 2024 pm 12:45 PM

在AlpineLinux上,你可以使用iptables工具来配置和管理防火墙规则。以下是在AlpineLinux上启用或禁用防火墙的基本步骤:检查防火墙状态:sudoiptables-L如果输出结果中显示有规则(例如,有一些INPUT、OUTPUT或FORWARD规则),则表示防火墙已启用。如果输出结果为空,则表示防火墙当前处于禁用状态。启用防火墙:sudoiptables-PINPUTACCEPTsudoiptables-POUTPUTACCEPTsudoiptables-PFORWARDAC

Linux Debian11服务器安装SSH,创建新用户并允许SSH远程登录,及SSH安全登录配置!Linux Debian11服务器安装SSH,创建新用户并允许SSH远程登录,及SSH安全登录配置!Mar 01, 2024 pm 07:16 PM

在Debian11服务器上安装SSH并创建新用户允许SSH远程登录的步骤如下:步骤1:安装SSH为了安装SSH服务器,您需要以root用户或具有sudo特权的用户身份登录到您的Debian11服务器。在终端中执行以下命令来安装SSH服务器:sudoaptupdatesudoaptinstallopenssh-server步骤2:创建新用户要创建一个新用户,您可以使用adduser命令。将下面的命令替换为您想要的用户名:sudoaddusernew_username系统会提示您设置新用户的密码和其

nginx反向代理缓存教程。nginx反向代理缓存教程。Feb 18, 2024 pm 04:48 PM

以下是nginx反向代理缓存的教程:安装nginx:sudoaptupdatesudoaptinstallnginx配置反向代理:打开nginx配置文件:sudonano/etc/nginx/nginx.conf在http块中添加以下配置来启用缓存:http{...proxy_cache_path/var/cache/nginxlevels=1:2keys_zone=my_cache:10mmax_size=10ginactive=60muse_temp_path=off;proxy_cache

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.