LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Syndicated Linux News (https://www.linuxquestions.org/questions/syndicated-linux-news-67/)
-   -   LXer: Should We Abolish User Access to rm? (https://www.linuxquestions.org/questions/syndicated-linux-news-67/lxer-should-we-abolish-user-access-to-rm-858850/)

LXer 01-26-2011 01:51 PM

LXer: Should We Abolish User Access to rm?
 
Published at LXer:

Lately, I’ve been hearing system administrators and managers ask about solutions to keep people from accidentally removing their data. These are very smart and dedicated people asking for a solution so that data isn’t lost either by accident or on purpose. A wild idea I’ve heard to solve the problem is getting rid of user access to the rm command. Is this truly a crazy idea?

Read More...

smoker 01-26-2011 02:31 PM

First you have to decide who the data belongs to.

TobiSGD 01-26-2011 04:22 PM

I don't think that a restriction access to rm would help. Some users are dumb enough to delete their data in the app that they are using and then save the file. This way, the data is also lost, without using rm.

Question: If I delete a file using a file-manager, is this file-manager using rm to delete it?

H_TeXMeX_H 01-27-2011 04:33 AM

Quote:

Originally Posted by TobiSGD (Post 4238738)
Question: If I delete a file using a file-manager, is this file-manager using rm to delete it?

Depends on the file manager and settings. I set it to delete files immediately without confirmation (using rm) ... and I have never deleted any file I didn't want to delete ... no mistakes.

I think it's the extra confirmation that induces mistakes. I remember when I was using Window$ that there was always a confirmation, and sometimes I pressed the wrong button. It seems that removing the confirmation helps because: it makes you more careful, and it removes unnecessary confirmation.

For root, I have made a wrapper script for rm that will prevent deleting top level directories and two levels down or so, plus no recursive.

brianL 01-27-2011 11:14 AM

Are you sure you want to delete?
Yes
Really certain?
Yes
Last chance. Are you sure you don't want to change your mind?
Yes
OK then, but don't come crying to me in a couple of days when you realise you've made a mistake.

Jeebizz 01-27-2011 11:30 AM

Quote:

Originally Posted by brianL (Post 4239669)
Are you sure you want to delete?
Yes
Really certain?
Yes
Last chance. Are you sure you don't want to change your mind?
Yes
OK then, but don't come crying to me in a couple of days when you realise you've made a mistake.

Sounds like Debian to me. I have a shell account at my uni. their server is running Debian and every time I want to rm a file in my directory I am always asked to confirm it. Its fscking annoying, especially when I want to just get rid of a directory, then I get asked file-by-file if I want to delete it!
Attachment 5980

Is this how Debian is by default? :scratch: If so it is just plain fscking stupid if you ask me! :banghead:

brianL 01-27-2011 11:34 AM

Mmm, never come across that before. Maybe rm is aliased by default to rm -i.
Next time I boot into my debian, I'll try deleting something.

Jeebizz 01-27-2011 11:40 AM

Perhaps, but even the login shell wasn't to my liking until I put:
Code:

export PS1='\u@\h:\w\$ '
in .bashrc. I got tired of issuing pwd to remind me what directory I was in. Plus it felt more like Slackware again :p.

-edit

You were right. I checked .bash_aliases:

alias rm='rm -i' :doh: I'll just go ahead and change that now... :)

TobiSGD 01-27-2011 11:41 AM

Quote:

Originally Posted by Jeebizz (Post 4239688)
Sounds like Debian to me. I have a shell account at my uni. their server is running Debian and every time I want to rm a file in my directory I am always asked to confirm it. Its fscking annoying, especially when I want to just get rid of a directory, then I get asked file-by-file if I want to delete it!
Attachment 5980

Is this how Debian is by default? :scratch: If so it is just plain fscking stupid if you ask me! :banghead:

That is not the Debian default. I think the administrators have set up an alias for rm to rm -i. May be they have to deal with many dumb users.

Quote:

Perhaps, but even the login shell wasn't to my liking until I put:
Code:

export PS1='\u@\h:\w\$ '

in .bashrc. I got tired of issuing pwd to remind me what directory I was in. Plus it felt more like Slackware again .
Also not Debian default. I never chnged the prompt and I can see where I am.

brianL 01-27-2011 11:45 AM

I've got some weird kind of love/hate relationship with Debian. I keep installing it as a dual-boot with Slack, then getting fed up with it after a couple of weeks. This has happened a few times. :scratch:

Jeebizz 01-27-2011 11:45 AM

Huh, well I just took out alias rm= 'rm -i', logged out and came back, and it still acts the same...

brianL 01-27-2011 11:47 AM

Are you sure you want to remove rm -i?
Really certain?
etc
etc
etc

pwc101 01-27-2011 11:53 AM

Quote:

Originally Posted by H_TeXMeX_H (Post 4239281)
For root, I have made a wrapper script for rm that will prevent deleting top level directories and two levels down or so, plus no recursive.

GNU rm already has a --preserve-root flag (which is enabled by default), so that even as root, you can't rm the contents of the root directory.

pwc101 01-27-2011 11:56 AM

Quote:

Originally Posted by Jeebizz (Post 4239707)
Huh, well I just took out alias rm= 'rm -i', logged out and came back, and it still acts the same...

It's probably set from /etc/profile too. Try putting unalias rm in your .bash_profile or .bashrc.

However, if you delete all your work and ask the sysadmins to put it back, they may not take too kindly to you having removed their safety net...

Jeebizz 01-27-2011 12:05 PM

Ah well I don't have .bash_profile, and that file isn't even located in /usr/share/skel, just .bashrc where I copied to my home so I could at least change the way my login prompt is. I obviously can't modify /etc/profile but the alias for rm isn't even there anyways. Also I already removed alias rm= i from that file (.bash_aliases in my home).

Again I only assumed this is how Debian is by default, since all the aliases and .bashrc stuff is in some folder called /skel in /usr/share which is also something not found in Slackware.

Oh well I guess I will just have to live with it. At least my prompt is in the proper manner.


All times are GMT -5. The time now is 11:12 PM.