LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-06-2005, 11:10 PM   #1
Zinghung
LQ Newbie
 
Registered: Jul 2005
Posts: 5

Rep: Reputation: 0
Question Remote shutdown?


I am a new user of linux. I am using KNOPPIX and I would like to know how to shut down another computer(using redhat) through lan, is there anyone can help?
 
Old 07-06-2005, 11:14 PM   #2
ashamril
Member
 
Registered: Jan 2003
Location: cyberjaya
Distribution: rh mdk deb fed suse
Posts: 99

Rep: Reputation: 15
ssh to the server & use commands shutdown -h now or init 0
 
Old 07-07-2005, 02:23 AM   #3
Zinghung
LQ Newbie
 
Registered: Jul 2005
Posts: 5

Original Poster
Rep: Reputation: 0
what if I want to set up a password so that I need to type in the password before shutdown?
thankyou very much
 
Old 07-07-2005, 04:25 AM   #4
Ruben2
Member
 
Registered: Sep 2004
Location: Lelystad, NL
Distribution: Debian Etch
Posts: 123

Rep: Reputation: 15
You'll need to type a password before you can login with ssh, or you can use ssh keys, which is even more secure. So a (root) password is required before you can shutdown the pc.
 
Old 07-08-2005, 01:06 AM   #5
Zinghung
LQ Newbie
 
Registered: Jul 2005
Posts: 5

Original Poster
Rep: Reputation: 0
In fact I would like to know whether I can type in only one like command and remote shut down other's computer???
my boss need it!!!!urgent
 
Old 07-08-2005, 02:01 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
If you setup ssh keys in the remote box for the root user then you can use a command like this:
Code:
ssh root@remote.box.com /sbin/init 0
Of course you must allow root to ssh (change sshd_config in the remote box accordingly)

Regards
 
Old 07-08-2005, 06:07 AM   #7
Zinghung
LQ Newbie
 
Registered: Jul 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Sorry, how should I input the ip address of th******e other computer?
since i saved the command , it still dun work
 
Old 07-08-2005, 06:59 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You must first create your pair of ssl keys in the local box (if they don't exist):
Code:
ssh-keygen -t rsa -b 1024 -P ""
Tranfer the file ~/.ssh/id_rsa.pub in the remote box and take a look under the root's home directory (usually /root). If there is a subdir named .ssh go in there and look for a file named authorized_keys. If it exists just copy the contents of id_rsa.pub in there. If not rename "id_rsa.pub" to "authorized_keys".
In the remote box you must enable sshd and edit it's config file (usually /etc/ssh/sshd_config). Find the line
Code:
PermitRootLogin no
and change "no" to "yes". After this restart sshd and try the command I gave you. If you want to use IP, run:
Code:
ssh root@xx.xx.xx.xx /sbin/init 0
Good luck

Last edited by bathory; 07-08-2005 at 07:00 AM.
 
  


Reply



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
remote shutdown scott4957 Linux - Software 2 11-15-2005 11:00 PM
Remote shutdown mrbabis Linux - Newbie 3 10-26-2005 08:46 AM
Remote Shutdown? [LAG] Prude Linux - Networking 7 02-27-2005 08:08 PM
Remote Shutdown Spyder_Snyper Linux - Networking 1 01-24-2005 08:49 PM
Remote shutdown Tarantismic Yak Linux - Security 1 06-04-2001 09:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:42 AM.

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
Open Source Consulting | Domain Registration