Running a command on remote system .
Hello
I want to remote login as a non root user and then run a command under the root account. I have set up the ssh/scp for the non root user and this configuration works fine. What I dont know is how to run a command under root once remotly logged in as the non-root account. I have to run this command under root, it cannot be changed. If anyone knows how to do this or has any suggestions that would be great. Systems are Redhat ES5 x64 2.6 Dee |
Make sure 'PermitRootLogin' is enabled on the sshd_config on the server side. Then just su to become root and run the command. Or the alternative is to add that command to the sudoers file and sudo command.
|
Quote:
|
Quote:
|
Is it a common reoccurring daily type command, or every once and a while just when needed type of thing?
If it needs to be done daily, weekly, monthly, hourly, etc, then setup a CRON job to do it. You won't even need to log on to the system. |
i do this everyday before i go to bed to shut off my htpc:
Code:
ssh xbmc@192.168.1.105 sudo shutdown -h now |
All times are GMT -5. The time now is 04:40 AM. |