全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 2050|回复: 25
打印 上一主题 下一主题

甲骨文 新加坡 大佬们就别说删了重建了

[复制链接]
1#
发表于 2021-12-11 14:04:15 | 显示全部楼层
  1. man sudo

  2. -i, --login
  3.                  Run the shell specified by the target user's password database entry as a login shell.  This means that lo‐
  4.                  gin-specific resource files such as .profile, .bash_profile or .login will be read by the shell.  If a com‐
  5.                  mand is specified, it is passed to the shell for execution via the shell's -c option.  If no command is spec‐
  6.                  ified, an interactive shell is executed.  sudo attempts to change to that user's home directory before run‐
  7.                  ning the shell.  The command is run with an environment similar to the one a user would receive at log in.
  8.                  Note that most shells behave differently when a command is specified as compared to an interactive session;
  9.                  consult the shell's manual for details.  The Command environment section in the sudoers(5) manual documents
  10.                  how the -i option affects the environment in which a command is run when the sudoers policy is in use.
复制代码


-i直接调用.bash_profile文件,可能读取阻塞啦?

如果要切换root 直接sudo su root不就好了

点评

su root环境变量不一定完全切换,应该用su -  发表于 2021-12-11 14:09
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-21 16:38 , Processed in 0.105806 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表