LinuxQuestions.org
Visit Jeremy's Blog.
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 04-09-2003, 11:26 PM   #1
PlatinumRik
Member
 
Registered: Feb 2003
Location: Buffalo, NY
Distribution: Novell Linux Desktop
Posts: 159

Rep: Reputation: 30
Shutting Down


is it at all possible to remotely shut down a remote linux box over telnet or do you need to be at the box to shutdown/reboot it?

rick
 
Old 04-10-2003, 12:03 AM   #2
jamrock
Member
 
Registered: Jan 2003
Location: Kingston, Jamaica
Posts: 444

Rep: Reputation: 41
Not sure.

Anyway, whatever you do, don't use telnet. Passwords are sent in clear text so anyone with a sniffer can get your paswords and access to your server.

Ssh is a better way to go. There may be other choices as well.

Peace.
 
Old 04-10-2003, 12:06 AM   #3
rmartine
Member
 
Registered: Dec 2002
Location: San Luis Obispo, CA
Distribution: Fedora Core 3
Posts: 618

Rep: Reputation: 30
Yeah it is possible. You need to set some permission flags somewhere because shutting down/rebooting isn't usually allowed on remote login.

Good Luck
 
Old 04-10-2003, 12:16 AM   #4
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
yes, you should be able to, especially if you ssh as root, but definately ssh, and not telnet
telnet is good for running an internet bbs, but not much more if you want your box to be secure
 
Old 04-10-2003, 02:18 AM   #5
Magueta
LQ Newbie
 
Registered: Apr 2003
Location: Toronto, Ontario, Canada
Distribution: Red Hat
Posts: 29

Rep: Reputation: 15
Yes, it is definitely possible. Ditto on ssh.

Joe
 
Old 06-09-2003, 06:32 AM   #6
Xiaoma
LQ Newbie
 
Registered: Jun 2003
Location: Milano, Italy
Distribution: Mandrake 10.1
Posts: 6

Rep: Reputation: 0
Now let's make it more difficult..

I need to power off a Linux box without keyboard and monitor, from a remote Java application.

I already tried to execute a shutdown or a poweroff via system exec, but it needs a root user connected to system console. If I try to exec "poweroff" from ssh it works, so it is not a problem of user permission.

Reading man of shutdown it says somebody HAS to be logged... and this is not possible in my case...

I cannot give ssh (or telnet) access to windows users, they just need to push a button (they are just Win users.. )

Anybody knows some useful trick?
Thank you in advance...
 
Old 06-09-2003, 08:03 AM   #7
Magueta
LQ Newbie
 
Registered: Apr 2003
Location: Toronto, Ontario, Canada
Distribution: Red Hat
Posts: 29

Rep: Reputation: 15
Maybe you can write a script on the Linux box that you can use for shutdown and that's executable by the user that your Java application runs under. It is possible to create scripts that will login to the system and su to root. I've heard it being done with "expect" it's a utility that's available on the RedHat Linux CD. It can use the data that's been output by the system to decide what data information it should provide. For example, if Login appears on the screen you can use expect to provide the login and password etc. At least I think it's called expect please verify, but I'm sure that the utility exists.

Joe
 
Old 06-09-2003, 08:18 AM   #8
Xiaoma
LQ Newbie
 
Registered: Jun 2003
Location: Milano, Italy
Distribution: Mandrake 10.1
Posts: 6

Rep: Reputation: 0
Quote:
Originally posted by Magueta
Maybe you can write a script on the Linux box that you can use for shutdown and that's executable by the user that your Java application runs under. It is possible to create scripts that will login to the system and su to root. I've heard it being done with "expect" it's a utility that's available on the RedHat Linux CD. It can use the data that's been output by the system to decide what data information it should provide. For example, if Login appears on the screen you can use expect to provide the login and password etc. At least I think it's called expect please verify, but I'm sure that the utility exists.

Joe
Wow... this will leave a script with a root login in clear text...

Right now, if I'm connecting with the application user via ssh, and I type poweroff, it works without problem... but using for example crontab is not giving any result, like via Java exec...

Maybe is something on environment of crond and JVM...
 
  


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
shutting down xNerox Linux - General 1 07-27-2004 03:28 PM
Shutting down X euphoria Linux - Newbie 3 02-25-2004 06:37 PM
Shutting Down emperorjordan Mandriva 1 02-23-2004 02:10 PM
Shutting Down X Aljaber Slackware 8 11-09-2003 02:00 AM
Shutting down odin123 Linux - Hardware 1 09-27-2002 07:24 AM

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

All times are GMT -5. The time now is 03:27 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