"ssh hostname -t sudo service httpd start" fails to start httpd.
Issue
- "ssh hostname -t sudo service httpd start" fails to start httpd.
"ssh hostname -t service httpd start" fails too.
# ssh www1 -t service httpd start
root@host_name's password:
Starting httpd: [ OK ]
Connection to www1 closed.
# ssh www1 -t service httpd status
root@host_name's password:
httpd dead but subsys locked
Connection to www1 closed.
#
ssh option -t is needed to execute sudo remotely. Refer to While trying to execute sudo command remotely using ssh, why does it result in a tty error ?
Environment
- Red Hat Enterprise Linux 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.