无法切换根

无法切换根

当我使用命令输入 p/w 来切换 root 时,收到以下消息

$ sudo -l

env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User riwajt may run the following commands on riwaj:
    (ALL : ALL) ALL

答案1

sudo -l是命令列表允许和禁止的命令。来自man sudo

 -l, --list  If no command is specified, list the allowed (and forbidden)
             commands for the invoking user (or the user specified by the
             -U option) on the current host.

你可能会-l混淆-i--login

 -i, --login
             Run the shell specified by the target user's password data‐
             base entry as a login shell. 

或者su -l

   -, -l, --login
       Provide an environment similar to what the user would expect had
       the user logged in directly.

相关内容