Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ssh WHM with Centos:/etc/sudoers ALL=(ALL)-切换到root时仍要求输入root密码_Ssh_Cpanel_Centos6_Ssh Keys_Whm - Fatal编程技术网

Ssh WHM with Centos:/etc/sudoers ALL=(ALL)-切换到root时仍要求输入root密码

Ssh WHM with Centos:/etc/sudoers ALL=(ALL)-切换到root时仍要求输入root密码,ssh,cpanel,centos6,ssh-keys,whm,Ssh,Cpanel,Centos6,Ssh Keys,Whm,我正在试图找出添加以下内容后的原因: newsshadmin ALL=(ALL) ALL 在Centos上的/etc/sudoers文件中,我在尝试切换到root时仍被要求输入root密码,即: ssh newsshadmin@ip_address su - root 这将触发密码提示。要使用sudo,必须先执行sudo命令,然后再执行任何其他命令,如sudo su-root 另一个问题是您用来允许su命令不带密码的行,这是正确的输入: newsshadmin ALL=(A

我正在试图找出添加以下内容后的原因:

newsshadmin    ALL=(ALL)       ALL
在Centos上的
/etc/sudoers
文件中,我在尝试切换到root时仍被要求输入root密码,即:

ssh newsshadmin@ip_address
su - root

这将触发密码提示。

要使用sudo,必须先执行sudo命令,然后再执行任何其他命令,如sudo su-root

另一个问题是您用来允许su命令不带密码的行,这是正确的输入:

newsshadmin ALL=(ALL) NOPASSWD: NOPASSWD: ALL