0

When there are multiple simultaneous SSH connections open, only the first two can sudo. In the third connection, one gets asked for a password, altough the user doesn't have a password set.

First connection:

manuel@manuelthinkpad:~$ ssh manuel-nas-wan 
Enter passphrase for key '/home/manuel/.ssh/manuel-thinkpad-arbeit.ed25519': 
Linux manuel-nas 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Dec  5 13:59:52 2017 from xxx.xxx.xxx.xxx

user@manuel-nas:~$ sudo pwd
/home/user

Second connection:

(Equal to first connection)

Third connection:

manuel@manuelthinkpad:~$ ssh manuel-nas-wan
Enter passphrase for key '/home/manuel/.ssh/manuel-thinkpad-arbeit.ed25519': 
Linux manuel-nas 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Dec  5 14:27:00 2017 from xxx.xxx.xxx.xxx

user@manuel-nas:~$ sudo pwd
[sudo] password for user: 

Question

Can anyone tell me the reason, and how to deactivate this behavior? I want to be able to sudo from all of my connections, not just the first two.

Thanks!

  • 1
    Note that the password you are asked for by sudo is your own, not root's. Root having or not having a password is irrelevant. – Kusalananda Nov 3 '17 at 10:35
  • @Kusalananda: Of course, you're right. I corrected my post. Thank you! – Multisync Nov 3 '17 at 11:15
  • You've to check the sudo rules with the visudo tool. By the way you've to check the sshd configuration in your /etc/ssh/sshd_config file for acknowledge if ssh permit root login or not. – dubis Nov 3 '17 at 11:30
  • @dubis: Password-authentification is disabled for root, thanks for the reminder. sudo visudo --check emits: /etc/sudoers: parsed OK\n /etc/sudoers.d/README: parsed OK – Multisync Nov 3 '17 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.