LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-18-2005, 08:20 AM   #1
coco03
LQ Newbie
 
Registered: Mar 2004
Posts: 9

Rep: Reputation: 0
rename reboot command


Hi,

for security reasons, I would like to rename the "reboot" command.
I have renamed "reboot" ---> "reboot_server"

But this command is a symbolic link to "halt" and if I execute "reboot_server", the server only shutdown and don't reboot.

How to make the "reboot_server" command doing the same as "reboot" command ??

Thanks
Charlie
 
Old 04-18-2005, 08:38 AM   #2
Vookimedlo
Member
 
Registered: Jul 2004
Location: Czech Republic - Roudnice nad Labem
Distribution: Debian
Posts: 253

Rep: Reputation: 34
Hi,

If you want to do some security settings, look at /etc/pam.d/reboot.



If you want to create the new link that do the same thing like something in /sbin/, Look at Fedora solution. They are using pair of links in /sbin and /usr/bin directory.

see man consolehelper
 
Old 04-18-2005, 08:58 AM   #3
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 14.1, 14.2; Debian Buster; Kali
Posts: 318

Rep: Reputation: 38
I think it might be easier to create an alia for the command. In the login profile, .bashrc, you may see alises listed which get invoked at boot time. Redhat used to have an alias of rm to rm -i for root, which would force a response as files were about to be removed. You could do something similar. The syntax is something like alias reboot='reboot_server'. I think aliases are one of the best features of the Unix, and linux environments. They shopuld probably be used a lot more.
 
Old 04-18-2005, 10:48 AM   #4
punt
Member
 
Registered: Jun 2001
Distribution: Fedora 22
Posts: 371

Rep: Reputation: 30
Quote:
Originally posted by apolinsky
I think it might be easier to create an alia for the command. In the login profile, .bashrc, you may see alises listed which get invoked at boot time. Redhat used to have an alias of rm to rm -i for root, which would force a response as files were about to be removed. You could do something similar. The syntax is something like alias reboot='reboot_server'. I think aliases are one of the best features of the Unix, and linux environments. They shopuld probably be used a lot more.
while aliases are very helpful, i think that the original poster does not want "reboot" as a command to be used at all, so an alias is not the way to go for this one.
 
Old 04-18-2005, 11:04 AM   #5
coco03
LQ Newbie
 
Registered: Mar 2004
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for your help,

I have renamed : reboot -->reboot_server, halt --> halt_server and shutdown --> shutdown_server

then I have used aliases :

alias reboot_server='shutdown_server -r now'
alias reboot='echo "type reboot_server if you are shure you want to reboot the server" '

And it works


Cococh
 
Old 04-18-2005, 01:48 PM   #6
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
I don't understand how this is any more secure.


--Shade
 
Old 04-19-2005, 02:11 AM   #7
coco03
LQ Newbie
 
Registered: Mar 2004
Posts: 9

Original Poster
Rep: Reputation: 0
It is more secure because all engineer of my compagny are connected with ssh to there own linux computer and to servers.
Sometimes, someone reboot a server instead of its computer.
Now, in order to reboot a server you have to type "reboot_serverXXX", and the "reboot" command is disable.

COCOCH
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to rename a file from command line ??? waelaltaqi Linux - Software 1 11-17-2005 01:49 PM
How to rename a file from command line ??? waelaltaqi Linux - Software 2 11-17-2005 01:43 PM
rename command or PERL perlexpr? malaka56 Linux - Software 1 08-24-2005 12:34 PM
rename command won't work Red Squirrel Linux - Newbie 4 03-03-2004 08:53 PM
rename with command line shanenin Linux - Software 1 09-25-2003 07:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:51 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
Open Source Consulting | Domain Registration