-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sudo won't accept password on remote host #112
Comments
@VojtechVitek do you think we can add input for asking password? |
Getting the same behaviour deploying on my CentOS server |
Are all the examples done with passwordless sudo? |
Yes, all the examples were done with password-less sudo. It all comes down to the infrastructure set-up. From my experience, most of the companies use private/public SSH key pairs to login to the instances (sometimes via a bastion host) and then the sudo itself doesn't have password, but is restricted to certain commands (like. There was some work done to make |
man sudo
@VojtechVitek @alinz You dont' ask me, but IMHO: in this cases it's better to add cookbook with answers like this, than add a new feature that do exactly the same, but with new syntax. |
I have a command in my Supfile
sudo systemctl restart myservice.service
.When running it against a localhost host it asks for a sudo password just fine, and accepts my input. However when running it against a remote ubuntu host, it doesn't show the password prompt and it looks like sup is hanging.
When pressing ^C then it prints: [sudo] password for xxxx: followed by terminating the connection.
Adding:
stdin:true
seems to do the trick, however it then prints out[sudo] password for xxxx:
after i type my password. (It looks like it hangs, i write the password, it prints out [sudo] password for xxxx and then accepts the password i typed in. On the same time, my password is printed to the console when typeing. Hence noread -s
functionality.Alternatively adding
%xxxx ALL=NOPASSWD: /bin/systemctl stop myservice.service
to the sudoers file on the remote host also works. Since it will then skip asking for password.Here's a minimal Supfile to recreate my issue:
My Dev machine is running arch linux and the server is running Ubuntu 16.04.2 LTS.
The text was updated successfully, but these errors were encountered: