Solved

Remote Shutdown

Posted on 2001-06-04
3
226 Views
Last Modified: 2013-12-16
I'm pretty much a Newbie when it comes to Linux, so the answer to this question should be pretty simple.

I'm running Redhat 7 on an old PC, since I only have one monitor, I telnet into the linux box using a terminal emulator. Since noone can telnet using the root user, I go across as a user and then su. (I'm not very concerned with security at the moment)

But... if I do this, I cant run the shutdown command - in fact the bash shell doesn't even recognise it as a command, even though I can look it up in the manual.

Is this some kind of security? It means that I need to pull the monitor out of the PC and plug it into the Linux machine just to shut it down  -  something I'd like to do remotely.

Is there a configuration file somewhere or something I can do to permit a remote shutdown?

g
0
Comment
Question by:grahamn1
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 50 total points
ID: 6154965
As an ordinary user /sbin (where shutdown lives) probably isn't in your PATH. You could add explicity invoke shutdown as "/sbin/shutdown -h now", or you could add /sbin to your PATH, or invoke "su - root" instead of "su". "su - root" will cause the login environment for root to be set up as if root had directly logged in and you'll be able to run shutdown and a number of other things that live in /sbin.
0
 

Author Comment

by:grahamn1
ID: 6155778
Thanks heaps - got it in one

g
0
 

Author Comment

by:grahamn1
ID: 6155782
Thanks heaps - got it in one

g
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now