How to create a file even root user also cant delete?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to create a file even root user also cant delete?
# 1  
Old 03-07-2014
Linux How to create a file even root user also cant delete?

Is there any way to create a file in linux that root user also can't delete?

Last edited by palani13dec; 03-07-2014 at 08:02 AM..
# 2  
Old 03-07-2014
No, unless it is on an NFS filesystem where the server does not permit the client to have update access. Of course, then you have to secure the server.......
# 3  
Old 03-07-2014
Quote:
Originally Posted by palani13dec
Is there any way to create a file in linux that root user also can't delete?
You cannot prevent root from being root.

Some filesystems like ext3 have extended options you can set for a file to make it undeletable even by root. Root can also turn this bit back off.

You cannot prevent root from being root.

If your security plan, depends on preventing root from being root, it's fatally flawed.
# 4  
Old 03-07-2014
Just burn the file on to a CD. It will mount read-only. Root won't be able to delete that.

I thought that I had seen thumb drives with a switch to render them read-only. But I don't see any now. Maybe I was just dreaming.
These 2 Users Gave Thanks to Perderabo For This Post:
# 5  
Old 03-07-2014
Quote:
Originally Posted by Perderabo
Just burn the file on to a CD. It will mount read-only. Root won't be able to delete that.

I thought that I had seen thumb drives with a switch to render them read-only. But I don't see any now. Maybe I was just dreaming.
That is brilliant and simple!

SD-cards also have a read-only switch.
# 6  
Old 03-08-2014
The problem is that root can always un-mount it and the file has 'gone'. I suppose that's true of my NFS suggestion too.

It's a puzzler. What is the need for an un-deleteable file anyway?


If we understood that, then maybe we have something more to consider.



Robin
This User Gave Thanks to rbatte1 For This Post:
# 7  
Old 03-08-2014
Back in the 80's I worked for a company that had source code licenses to System V Unix and HP-UX. Management, in their wisdom, had decreed that the software developers had access to root. I put the source code on a read-only partition. This protected it from programmers that sat all day in a root shell and always used "vi" rather than "view". They were clueless but not malicious.

My current employer works with some US government agencies and one of them examined a linux system prior to being connected to closed network. One of the changes they demanded was for me to set the immutable flag on grub.conf. So I did. And yes, root can turn off the flag, change the file, then turn the flag back on. I also thought that grub.conf was odd choice to be the only file needing extra protection.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Create user with sudo ability to root.

Hi All, I need to give an user sudo ability to root. We have also generated RSA key but unable to proceed further. For example after a user logs into the server normally and when he executes below command $ssh root@server_name This should take you to root prompt # Please help me.... (3 Replies)
Discussion started by: Rockyc3400
3 Replies

2. UNIX for Advanced & Expert Users

Root and non-root user not able to delete the file

Hi!! one strange problem occurred with my RHEL 5 box. i'm having logs folder with ownership of non-root user. Created some files with root user under logs folder. here is the scene: -rw-r----- 1 root root 1048227 Feb 28 12:34 SystemOut_13.02.28_12.34.10.log -rw-r----- 1 root root ... (6 Replies)
Discussion started by: sukhdip
6 Replies

3. AIX

How to create a user as a root

please give me any suggestion, how can i create user as root privilege. (please give me very safest way because i have production servers) (5 Replies)
Discussion started by: reply.ravi
5 Replies

4. Solaris

Unable to create or delete a directory in /usr with root user

Hi All, I am trying to uninstall jdk 1.5 from my Solaris 10 64 bit but some how was not successful.so tried to delete the folder of jdk from /usr but its throughing error as: Unable to remove directory jdk: Read-only file system Even I tried to create a dir in /usr but its not allowing me... (4 Replies)
Discussion started by: Pshah
4 Replies

5. UNIX for Dummies Questions & Answers

user able to delete directory owned by root

I've tried to figure this out. I'm only about 6 mos into my AIX admin duties, but I've got a "security" problem I can't figure out. I've created a sub directory as follows: drwx------ 2 root system 256 Apr 13 16:02 mike I've logged in another session with the following user: $ id... (2 Replies)
Discussion started by: mpheine
2 Replies

6. Shell Programming and Scripting

How to create a directory inside root as different user

Hi All, I have directory under /opt/test. The ownership of the test directory is root:root. I have login to the server as test user. I need to have some script to create a directory inside /opt/test. This script will be called as test user. When I try to execute... (4 Replies)
Discussion started by: kalpeer
4 Replies

7. AIX

create user like root

hello I would like to create another user like root With smit user, I have duplicate all the configuration from root to root2 (groupe, secondary group, administrative, etc...) But when I connect with root2, i don't go to all directory: "permission denied !" I don't understand where is the... (10 Replies)
Discussion started by: pascalbout
10 Replies

8. UNIX for Advanced & Expert Users

Other than root user .Normal user is unable to create files

Hi all, I am using Sun Solaris 9 .In this system normal users unable to create files from the command line.I added these users in bin,adm and even root group i found them unable to create a file. (1 Reply)
Discussion started by: mallesh
1 Replies

9. Red Hat

How can l create a user that as all the Attribute & Privilages of root

Hi, Is it possible to create a user in Linux 8.0 with all the attribute and the privilages of super user (root). Without using root as the logg in name. Thanx (6 Replies)
Discussion started by: kayode
6 Replies

10. UNIX for Dummies Questions & Answers

create or modify user account to have same access as root

Is there a way to create or better yet modify a user account so it has the same privs as root? (6 Replies)
Discussion started by: xadamz23
6 Replies
Login or Register to Ask a Question