[求助]debian 13 trixie 无法从 root 用户 login 到普通用户 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
Earthman
V2EX    Linux

[求助]debian 13 trixie 无法从 root 用户 login 到普通用户

  •  
  •   Earthman Dec 2, 2025 1762 views
    This topic created in 145 days ago, the information mentioned may be changed or developed.

    debian 13 trixie 新安装系统,当前用户为 root 的情况下无法 login 到普通用户,终端会直接断开,甚至到不了输入密码这一步。ssh 的情况下会断开连接 journalctl -xe 也看不什么有用到信息。

    未登录的情况下,可以直接登录为普通用户。在 ubuntu noble 系统下就没这问题。

    例如,当前是 root 用户:

    login <user> #终端挂掉

    su --login <user> #不要求密码直接切换

    sudo -i -u <user> #不要求密码直接切换

    8 replies    2025-12-03 12:27:48 +08:00
    wu67
        1
    wu67  
       Dec 2, 2025
    我记得是一开始是 admin 登进去, sudo -s 切 root. 用完 exit 回车 返回 admin. 再 exit 回车 断开 ssh 链接.
    nlzy
        2
    nlzy  
       Dec 2, 2025   3
    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.
    chinni
        3
    chinni  
       Dec 2, 2025
    machinectl shell <user>@
    Earthman
        4
    Earthman  
    OP
       Dec 3, 2025
    以前查过 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 居然没有记录
    Earthman
        5
    Earthman  
    OP
       Dec 3, 2025
    找到了更多信息

    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.
    iamwin
        7
    iamwin  
       Dec 3, 2025
    su username 不行吗?从来没遇到过你这种情况
    Earthman
        8
    Earthman  
    OP
       Dec 3, 2025
    @iamwin su 可以,但是传统的 login 不能以传统的方式用了
    About     Help     Advertise     Blog     API     FAQ     Solana     5596 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 51ms UTC 05:58 PVG 13:58 LAX 22:58 JFK 01:58
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86