- man sudo
-
- -i, –login
- Run the shell specified by the target user’s password database entry as a login shell. This means that lo‐
- gin-specific resource files such as .profile, .bash_profile or .login will be read by the shell. If a com‐
- mand is specified, it is passed to the shell for execution via the shell’s -c option. If no command is spec‐
- ified, an interactive shell is executed. sudo attempts to change to that user’s home directory before run‐
- ning the shell. The command is run with an environment similar to the one a user would receive at log in.
- Note that most shells behave differently when a command is specified as compared to an interactive session;
- consult the shell’s manual for details. The Command environment section in the sudoers(5) manual documents
- 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不就好了 |