1、su命令
su/su - username:切换用户,如果从root用户切换到切换用户,不需要其他用户的密码;username为空,默认为root用户,从普通用户切换到root用户,需要输入root用户的密码

login shell和non-login shell:
login shell是说在取得bash时需要完整的登陆流程,每个用户登陆取得bash的时候都会读取这个文件etc/profile
non-login shell就是取得bash不需要重复登录,就像你在桌面视图中用ctrl+alt+T启动的shell输入窗口就是non-login shell。还有就是你在shell窗口直接su切换的用户,都属于non-login shell。

su/su-后的区别:
1、如果直接su的话,不会读取/etc/profile的,所以你

收藏 打印