[Topic DIscussion] 如何打开终端时默认已root用户登录
Tofloor
poster avatar
幻想自由
deepin
2023-08-31 19:20
Author

普通用户登录ui界面,但是希望打开终端时默认以root用户登录,不需要经过sudo su - 方式切换,有什么方法设置吗

Reply Favorite View the author
All Replies
Jokul
deepin
2023-08-31 19:47
#1

感觉这个需求可以有,深度之家提需求吧(启动器终端右键添加管理员身份启动或者终端设置里可勾选启动是否以管理员运行)

Reply View the author
zed7th
deepin
2023-08-31 20:06
#2

登录系统的用户不是 root 用户,这样会很不安全,而且有很多应用和命令不适合在 root 用户执行,比如 pip install package

Reply View the author
北冥夜未央
deepin
Ecological co-builder
2023-08-31 20:09
#3

最好不要

Reply View the author
neko
deepin
Ecological co-builder
2023-08-31 21:08
#4

有办法,配置.bashrc进行ssh root@0 和免密登录。

Reply View the author
乾豫恒益
deepin
2023-08-31 21:53
#5

不太建议使用这种方法,这种方便是双向的,三思啊。

Reply View the author
幻想自由
deepin
2023-08-31 22:08
#6

主要是时平时用root比较多,不然挺多权限受限的

Reply View the author
忘记、过去
deepin
2023-09-01 02:07
#7

暴力方式:修改 ~/.bashrc,结尾处添加

echo '用户密码' | sudo -S x-terminal-emulator &> /dev/null
exit 0

保存后重启,或者终端执行 source ~/.bashrc 使配置生效


这样子打开终端时,会自动再打开一个 root 身份的终端;关闭 root 身份的终端时,普通身份的终端也会关闭。感觉除了会打开俩窗口外没啥大问题的样子......

虽然绝对不建议这么干就是了......

Reply View the author