Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Remote Shutdown

Posted on 2001-06-04
3
Medium Priority
?
239 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 200 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.
Suggested Courses
Course of the Month8 days, 7 hours left to enroll

877 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