debian 13 trixie 新安装系统,当前用户为 root 的情况下无法 login 到普通用户,终端会直接断开,甚至到不了输入密码这一步。ssh 的情况下会断开连接 journalctl -xe 也看不什么有用到信息。
未登录的情况下,可以直接登录为普通用户。在 ubuntu noble 系统下就没这问题。
例如,当前是 root 用户:
login <user> #终端挂掉
su --login <user> #不要求密码直接切换
sudo -i -u <user> #不要求密码直接切换
1
wu67 4 天前
我记得是一开始是 admin 登进去, sudo -s 切 root. 用完 exit 回车 返回 admin. 再 exit 回车 断开 ssh 链接.
|
2
nlzy 4 天前 Debian 13 把 /usr/bin/login 的实现从 shadow-utils 换成 util-linux 了,后者的手册里有一句话:
If one uses the command login, then the surrounding shell gets killed by vhangup(2) because it’s no longer the true owner of the tty. This can be avoided by using `exec login` in a top-level shell or xterm. |
3
chinni 4 天前
machinectl shell <user>@
|
4
Earthman OP 以前查过 release notes ,没写到这点。搜索也不易找到。
用这样的关键词才找到一点 "debian 13 login shadow-utils util-linux" 结果有条 Debian Trixie: Nested Logins Always Failing https://lists.debian.org/debian-user/2025/10/msg00183.html 测试过了,没法登录到其他用户,这么重要的 breaking change 居然没有记录 |
5
Earthman OP 找到了更多信息
A recursive login, as used to be possible in the good old days, no longer works; for most purposes [su]( https://manpages.ubuntu.com/manpages/plucky/man1/su.1.html) is a satisfactory substitute. Indeed, for security reasons, login does a [vhangup]( https://manpages.ubuntu.com/manpages/plucky/man2/vhangup.2.html) system call to remove any possible listening processes on the tty. This is to avoid password sniffing. If one uses the command login, then the surrounding shell gets killed by [vhangup]( https://manpages.ubuntu.com/manpages/plucky/man2/vhangup.2.html) because it’s no longer the true owner of the tty. This can be avoided by using exec login in a top-level shell or xterm. |
6
Earthman OP |
7
iamwin 4 天前
su username 不行吗?从来没遇到过你这种情况
|