惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V2EX - 技术
V2EX - 技术
博客园 - Franky
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
MongoDB | Blog
MongoDB | Blog
C
Check Point Blog
P
Proofpoint News Feed
雷峰网
雷峰网
F
Fortinet All Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
H
Help Net Security
T
Tailwind CSS Blog
博客园 - 聂微东
博客园 - 【当耐特】
S
Schneier on Security
The Hacker News
The Hacker News
I
Intezer
博客园 - 三生石上(FineUI控件)
量子位
AWS News Blog
AWS News Blog
T
The Exploit Database - CXSecurity.com
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
P
Palo Alto Networks Blog
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
NISL@THU
NISL@THU
宝玉的分享
宝玉的分享
Cyberwarzone
Cyberwarzone
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Threat Research - Cisco Blogs
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog
T
The Blog of Author Tim Ferriss
Security Latest
Security Latest
H
Hacker News: Front Page
Vercel News
Vercel News
A
Arctic Wolf
L
LINUX DO - 热门话题
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
Google Online Security Blog
Google Online Security Blog
W
WeLiveSecurity
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
O
OpenAI News
TaoSecurity Blog
TaoSecurity Blog
Jina AI
Jina AI
爱范儿
爱范儿

博客园 - KLAPT

Gateway 网关 CodeX =>Skills Redis 内存满了怎么处理 SpringBoot 默认配置修改 JWT 续签 Access Token + Refresh Token 双 Token claudeCode 命令 MyBatis 的 Mapper 接口 AI | CC GUI 集成 IDEA 完整教程 在IDEA中使用Claude Code IDEA中使用CodeX MyBatisPlus解决大数据量查询慢问题 idea 中的 claude code Token Dubbo 和 Spring Cloud Gateway的区别 Transactional 注解中propagation 掌握 Spring 框架这 10 个扩展点 SpringBoot 快速实现 api 加密 Spring Boot/Cloud 中 bootstrap.yml 与 application.yml SpringBoot 实现 DOCX 转 PDF 微服务Token鉴权设计的几种方案 进程、线程、协程 RSA 加密 Java二维码 ntp服务端和客户端 Chronyd与NTP chronyd 作为服务器时钟 chrony java -cp 和 java -jar Maven 项目打包:实现业务代码与第三方依赖分离 达梦数据库创建用户 梦数据库新增大字段报错问题 达梦数据库操作 MySQL UPDATE多表关联更新 达梦数据库 为HTTP POST请求设置请求体 在Java中调用第三方接口并返回第三方页面 Java调用第三方接口的方法 Nginx 之Rewrite 使用详解 linux 命令 Spring Boot项目中集成Spring Security OAuth2和Apache Shiro
sudo命令和su 的区别
KLAPT · 2026-01-29 · via 博客园 - KLAPT

su(switch user)和sudo(super user do)是Linux系统中用于权限管理的两个关键命令,主要区别在于su用于切换用户身份,而sudo用于以提升的权限执行单个命令。

  • su‌:用于切换用户身份的命令,默认切换到root用户,需要输入目标用户的密码(如root密码)。‌‌
  • sudo‌:允许普通用户以root或其他指定用户的权限运行单个命令,无需完全切换用户,需要输入当前用户的密码。‌‌
  1. ‌密码要求‌:su需要目标用户的密码;sudo需要当前用户的密码。‌‌
  2. 权限范围‌:su切换后获得目标用户的全部权限;sudo可通过/etc/sudoers文件精确控制用户能执行的命令,实现权限最小化。‌‌
  3. 环境变量‌:使用su -会加载目标用户的完整环境(login-shell);sudo默认保留当前用户的环境变量。‌‌
  4. ‌安全性‌:sudo更安全,无需共享root密码,且有操作日志记录;su需要共享root密码,存在安全风险。‌‌ 
  5. ‌使用方式‌:su启动一个新的shell会话,允许长时间以目标用户身份操作;sudo只执行单个命令后立即返回当前用户。‌‌ 
  6. ‌配置与日志‌:sudo通过/etc/sudoers文件配置权限,并记录日志供审计;su没有内置日志功能。‌‌