"ssh hostname -t sudo service httpd start" fails to start httpd.

Solution Unverified - Updated -

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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.