Difference between revisions of "Ssh - sudo no-tty-present-and-no-askpass-program-specified-error"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) (Created page with "sumber: https://stackoverflow.com/questions/21659637/how-to-fix-sudo-no-tty-present-and-no-askpass-program-specified-error Granting the user to use that command without prom...") |
Onnowpurbo (talk | contribs) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
sumber: https://stackoverflow.com/questions/21659637/how-to-fix-sudo-no-tty-present-and-no-askpass-program-specified-error | sumber: https://stackoverflow.com/questions/21659637/how-to-fix-sudo-no-tty-present-and-no-askpass-program-specified-error | ||
+ | |||
+ | |||
+ | Coba | ||
+ | |||
+ | ssh -t remotehost "sudo <cmd>" | ||
+ | |||
+ | ==Atau== | ||
+ | |||
Line 20: | Line 28: | ||
Use NOPASSWD line for all commands, I mean: | Use NOPASSWD line for all commands, I mean: | ||
+ | nicholsonjf ALL=NOPASSWD: ALL | ||
jenkins ALL=(ALL) NOPASSWD: ALL | jenkins ALL=(ALL) NOPASSWD: ALL | ||
Put the line after all other lines in the sudoers file. | Put the line after all other lines in the sudoers file. | ||
− | |||
− | |||
− | |||
− | |||
==Referensi== | ==Referensi== | ||
* https://stackoverflow.com/questions/21659637/how-to-fix-sudo-no-tty-present-and-no-askpass-program-specified-error | * https://stackoverflow.com/questions/21659637/how-to-fix-sudo-no-tty-present-and-no-askpass-program-specified-error |
Latest revision as of 07:39, 17 December 2018
Coba
ssh -t remotehost "sudo <cmd>"
Atau
Granting the user to use that command without prompting for password should resolve the problem. First open a shell console and type:
sudo visudo
Then edit that file to add to the very end:
username ALL = NOPASSWD: /fullpath/to/command, /fullpath/to/othercommand
eg
john ALL = NOPASSWD: /sbin/poweroff, /sbin/start, /sbin/stop
will allow user john to sudo poweroff, start and stop without being prompted for password.
atau yang lebih extrim
Use NOPASSWD line for all commands, I mean:
nicholsonjf ALL=NOPASSWD: ALL jenkins ALL=(ALL) NOPASSWD: ALL
Put the line after all other lines in the sudoers file.