LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   running ssh commands with sudoers login (https://www.linuxquestions.org/questions/linux-newbie-8/running-ssh-commands-with-sudoers-login-849487/)

konnara 12-10-2010 08:52 AM

running ssh commands with sudoers login
 
Dear All

I added the following line in /etc/sudoers file
<username> ALL=(ALL) NOPASSWD:ALL
after adding this if I run any command it is not asking for the password. Now I need to shutdown the remote machine with sudoers user.

please help me.

Regards
konnara

acid_kewpie 12-10-2010 09:00 AM

am i missing something here?? What's the problem... "sudo shutdown" ...:confused:

BTW, that's a *REALLY REALLY* bad thing to do, I'd *VERY* strongly suggest you don't do that ever ever ever.

darkefge 12-10-2010 02:09 PM

Should be simple as:

"ssh user@remote.host"

"sudo reboot -h"

konnara 12-12-2010 11:17 PM

Hi

I tried ssh <username>@hostip reboot, it is saying reboot: must be superuser.

My main idea is to run these command through PHP. I want to list all my render nodes in GUI, Whenever I want any node to be restart, shutdown or change os by using these commands.

Thanks in advance

Quote:

Originally Posted by darkefge (Post 4187329)
Should be simple as:

"ssh user@remote.host"

"sudo reboot -h"


TobiSGD 12-12-2010 11:36 PM

If you only want to reboot your system as normal user than restrict the sudo command to work only with reboot. Otherwise every attacker that manages to find out your password is able to do anything on your machine. Effectively it is a second root account.

techz123 12-13-2010 01:14 AM

are you trying to aah login without asking password?
try this link may be useful for you
http://servertechz.com/linux/ssh-log...rd-simple-way/

schneidz 12-13-2010 07:56 AM

Code:

ssh schneidz@hyper sudo shutdown -h now
?


All times are GMT -5. The time now is 05:46 PM.