?
Solved

Prevent Remote reboot Solaris 2.5

Posted on 1997-12-31
6
Medium Priority
?
436 Views
Last Modified: 2013-12-16
Is there a way to prevent remote reboot, init 0, or shutdown? Other than disabling the aforementioned commands.
Help???
0
Comment
Question by:maudib031397
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Author Comment

by:maudib031397
ID: 1812829
Edited text of question
0
 
LVL 12

Expert Comment

by:Otta
ID: 1812830
Rather than "disabling" the commands,
just rename them, to "hide" them.
Then, write a shell-script to
determine whether the user is "local" or "remote", and then to either REFUSE to execute the command, or to execute the renamed version of the command.

P.S. Why do you want to do this?
Do you like driving through snow-storms
in order to reboot a machine, rather than
using a remote login to do the same thing?
0
 
LVL 12

Expert Comment

by:Otta
ID: 1812831
Oops. Click on 'comment' instead of 'answer'.
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 5

Expert Comment

by:n0thing
ID: 1812832
No, if you don't want users to do a reboot on your machine
don't give them the root passwd. It doesn't help to rename or
hide it, so many commands to rename "reboot", "shutdown",
"init" ... if you rename them. You'll have lots of trouble
with "init" when the system reboot. Besides, anyone with root
could reboot your system easily without having access to those
commands by making a kernel panic ... or just copy the binaries
from another system. Don't give root if you don't want your system to reboot, and besides you cannot disabling ANYTHING from
root.

Regards,
Minh Lai
0
 

Expert Comment

by:psundstr
ID: 1812833
It depends what your concept of "remote" is.  Do you mean you only want to be able to shutdown the machine by logging on the console?  If so, you can restrict root login to the console, although that doesn't stop someone logging in as themselves and using su to gain root access (providing they have the root password of course).
0
 
LVL 1

Accepted Solution

by:
malec earned 400 total points
ID: 1812834
Put this into your /etc/cshrc:

if ($?REMOTEHOST) then
    echo ">>>  $REMOTEHOST : $USER"
    if (($REMOTEHOST == "host-you-allow-access") && ($USER == "account-you-allow-access")) then
       exit
    else
       /usr/sbin/playaiff /disk2/sounds/scream.wav
       echo "Whoa there, $REMOTEHOST. Stay away\!"
       echo "This break-in attempt is being logged complete with ethernet mask and IP of the intruder"
       echo "`date` : Attempt to log into Iona3 from $REMOTEHOST as $USER \n" >> /disk2/Standards/breakin.attempt
       /usr/bin/mail e@fa.com dio@sympatico.ca < /disk2/Standards/breakin.attempt
       logout > null
       exit
    endif
endif

What it does:

      1. Check if you are remote user.
      2. If you are, checks if you come from authorized machine and as authorized user.
      3. If yes - lets you in. If not, warns you, plays sound on your machine, logs IP address of the culprit and time of the attempt and e-mails this file to you and/or somebody else.

You still can rlogin to your own machine if you need to, but you have to come from certain machine as certain user.

Nice and short. Works with telnet too. I use it on my baby.

Have fun.

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

752 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