Original Message:
Sent: May 06, 2025 04:44 AM
From: Michael Mueller
Subject: remote gateway restart with ssgadmin
Hi Joseph.
Thank you very much. It looks obvious and promising.
However, its still not working for me as described.
The only scenario (as of now), where I am able to get it to run is by defining NOPASSWD for this command in /etc/sudoers.d/ssgadmin
Then I am able to do a
echo "sudo systemctl status ssg" | ssh ssgadmin@<gateway>
Anyway thanks for the hint. it pointed me in the right direction.
Best regards
...Michael
Original Message:
Sent: May 05, 2025 01:01 PM
From: Joseph Fry
Subject: remote gateway restart with ssgadmin
To run interactive commands, such as sudo, you need a pseudo terminal. Use the -t option to start one. An interactive session is started automatically if you don't specify a remote command to run.
ssh -t user@remote_server "sudo systemctl restart ssg"
Alternatively, I think you can pipe the commands to the SSH command rather that specifying them in the ssh command for example:
echo "sudo systemctl restart ssg" | ssh user@remote_server
Original Message:
Sent: May 05, 2025 11:44 AM
From: Michael Mueller
Subject: remote gateway restart with ssgadmin
Dear Team.
I am trying to restart the ssg service on a gateway from a remote box using ssh
The command I am using looks like:
ssh ssgadmin@<gateway> sudo systemctl restart ssg
After entering the password for ssgadmin, I get a permission denied error for this sudo command
What I don't understand: if I create a console session through
ssh ssgadmin@<gateway>
login with password, and enter the same command at the prompt:
sudo systemctl restart ssg
it works just fine.
Did I miss anything?
What am I doing wrong ?
Thank you
...Michael