How do I set up an alias of rm="rm -i" as the root user?

How do I set up an alias of rm="rm -i" as the root user?

Post by Mega » Thu, 03 Apr 2003 23:09:21



Hi all,

I want to set up some alias as the root user to prevent root from doing a rm
* and wiping out an entire system.  How do I set up an alias of  rm="rm -i"
as the root user.  I tried editing the /etc/profile, but no luck?

Help??!!

Please email me at dmegyesi at truecontext dot com

 
 
 

How do I set up an alias of rm="rm -i" as the root user?

Post by mgrd » Thu, 03 Apr 2003 23:54:00


the command is   alias rm='rm -i'  ie use single quotes

edit your /etc/profile and source it by running `. /etc/profile'


> Hi all,

> I want to set up some alias as the root user to prevent root from doing a rm
> * and wiping out an entire system.  How do I set up an alias of  rm="rm -i"
> as the root user.  I tried editing the /etc/profile, but no luck?

> Help??!!

> Please email me at dmegyesi at truecontext dot com

--
SDF - Super Dimensional Fortress
Public Access UNIX System - http://sdf.lonestar.org

 
 
 

How do I set up an alias of rm="rm -i" as the root user?

Post by Chris Co » Fri, 04 Apr 2003 03:36:16



> the command is   alias rm='rm -i'  ie use single quotes

> edit your /etc/profile and source it by running `. /etc/profile'

Nope.  The root shell should be assumed to be bourne shell.

However, you could setup a ksh file to source in after manually
invoking ksh as the root user.

If you're using Linux (where bash is the root shell... which
isn't fully bourne shell compatible btw).. then what is suggested
will work.. It's just not portable into Unix systems.

It is not recommended that you alias rm for root.
Better is to use a policy of using sudo (or other equivalent)
to perform root tasks to avoid working from an interactive
shell unless absolutely necessary.


>> Hi all,

>> I want to set up some alias as the root user to prevent root from
>> doing a rm
>> * and wiping out an entire system.  How do I set up an alias of  
>> rm="rm -i"
>> as the root user.  I tried editing the /etc/profile, but no luck?

>> Help??!!

>> Please email me at dmegyesi at truecontext dot com

 
 
 

How do I set up an alias of rm="rm -i" as the root user?

Post by p.. » Fri, 04 Apr 2003 03:40:33



> Hi all,
> I want to set up some alias as the root user to prevent root from doing a rm
> * and wiping out an entire system.  How do I set up an alias of  rm="rm -i"
> as the root user.  I tried editing the /etc/profile, but no luck?
> Help??!!
> Please email me at dmegyesi at truecontext dot com

You won't save your system by tweaking the 'rm' command, you
better spend some resources on restricting who may be root
and educate the ones that will have rootly powers.

Much more security from mishaps can be gained by carefully use
of 'sudo' where admins login as ordinary users and only get
full power during individual commands that really needs power.

--
Peter H?kanson        
        IPSec  Sverige      ( At Gothenburg Riverside )
           Sorry about my e-mail address, but i'm trying to keep spam out,
           remove "icke-reklam" if you feel for mailing me. Thanx.

 
 
 

How do I set up an alias of rm="rm -i" as the root user?

Post by Rev. Don Koo » Fri, 04 Apr 2003 06:51:09



> Hi all,

> I want to set up some alias as the root user to prevent root from doing a rm
> * and wiping out an entire system.  How do I set up an alias of  rm="rm -i"
> as the root user.  I tried editing the /etc/profile, but no luck?

> Help??!!

> Please email me at dmegyesi at truecontext dot com

        Depends on which version of UNIX you are using.

                Hope this helps,
                        Don

--
***************************   Q: How many frenchmen does it take
* Rev. Don McDonald, SCNA *      to defend Paris?
* Baltimore, MD           *   A: No one knows, it's never been tried.
***************************
http://mywebpages.comcast.net/oldno7/TheFrench.mpg
Reluctant Yamaha YZF-R1 Owner

 
 
 

How do I set up an alias of rm="rm -i" as the root user?

Post by Rev. Don Koo » Fri, 04 Apr 2003 06:53:19



> Hi all,

> I want to set up some alias as the root user to prevent root from doing a rm
> * and wiping out an entire system.  How do I set up an alias of  rm="rm -i"
> as the root user.  I tried editing the /etc/profile, but no luck?

> Help??!!

> Please email me at dmegyesi at truecontext dot com

        Depends on which version of UNIX you are using.

                Hope this helps,
                        Don

--
***************************   Q: How many frenchmen does it take
* Rev. Don McDonald, SCNA *      to defend Paris?
* Baltimore, MD           *   A: No one knows, it's never been tried.
***************************
http://mywebpages.comcast.net/oldno7/TheFrench.mpg
Reluctant Yamaha YZF-R1 Owner

 
 
 

How do I set up an alias of rm="rm -i" as the root user?

Post by Rev. Don Koo » Fri, 04 Apr 2003 07:02:08



> Hi all,

> I want to set up some alias as the root user to prevent root from doing a rm
> * and wiping out an entire system.  How do I set up an alias of  rm="rm -i"
> as the root user.  I tried editing the /etc/profile, but no luck?

> Help??!!

> Please email me at dmegyesi at truecontext dot com

        Depends on which version of UNIX you are using.

                Hope this helps,
                        Don

--
***************************   Q: How many frenchmen does it take
* Rev. Don McDonald, SCNA *      to defend Paris?
* Baltimore, MD           *   A: No one knows, it's never been tried.
***************************
http://mywebpages.comcast.net/oldno7/TheFrench.mpg
Reluctant Yamaha YZF-R1 Owner

 
 
 

1. How do I set up an alias of rm="rm -i" as the root user?

Hi all,

I want to set up some alias as the root user to prevent root from doing a rm
* and wiping out an entire system.  How do I set up an alias of  rm="rm -i"
as the root user.  I tried editing the /etc/profile, but no luck?

Help??!!

Please email me at dmegyesi at truecontext dot com

2. Anyone got a working xfig.3.2 for pmax NetBSD?

3. (sol8 (intel))alias rm to rm -i in ksh88

4. pppd does not log sometimes

5. UPS software issued "rm -rf /*" Now what?

6. Boot from CDROM fails

7. question on the disable_lock

8. Where are "rm" alias scripts?

9. "rm: Operation not permitted", even as root

10. rm -r /* as "normal User"

11. rm won't rm

12. find rm {} vs. rm -r