LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-10-2010, 09:52 AM   #1
konnara
LQ Newbie
 
Registered: Dec 2010
Posts: 2

Rep: Reputation: 0
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
 
Old 12-10-2010, 10:00 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

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

BTW, that's a *REALLY REALLY* bad thing to do, I'd *VERY* strongly suggest you don't do that ever ever ever.
 
Old 12-10-2010, 03:09 PM   #3
darkefge
LQ Newbie
 
Registered: Dec 2010
Location: Milwaukee
Distribution: Debian
Posts: 6

Rep: Reputation: 0
Should be simple as:

"ssh user@remote.host"

"sudo reboot -h"

Last edited by darkefge; 12-10-2010 at 03:10 PM.
 
Old 12-13-2010, 12:17 AM   #4
konnara
LQ Newbie
 
Registered: Dec 2010
Posts: 2

Original Poster
Rep: Reputation: 0
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 View Post
Should be simple as:

"ssh user@remote.host"

"sudo reboot -h"
 
Old 12-13-2010, 12:36 AM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853
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.
 
Old 12-13-2010, 02:14 AM   #6
techz123
LQ Newbie
 
Registered: Dec 2010
Location: India
Posts: 4

Rep: Reputation: 0
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/
 
Old 12-13-2010, 08:56 AM   #7
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,161

Rep: Reputation: 889Reputation: 889Reputation: 889Reputation: 889Reputation: 889Reputation: 889Reputation: 889
Code:
ssh schneidz@hyper sudo shutdown -h now
?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
running commands upon login abolishtheun Linux - General 2 02-27-2009 12:14 AM
ssh running remote commands Nikee Linux - Security 5 02-04-2006 04:00 AM
Running commands over ssh iago Programming 8 11-28-2004 01:13 PM
running commands automatically via SSH tpfraz Linux - General 1 02-13-2004 10:12 AM
SSH login commands not found ??? avierstr Mandriva 0 08-26-2003 08:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration