Visit Our UNIX and Linux User Community


permission 400

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat permission 400
# 1  
Old 10-27-2009
permission 400

#ls -l
-r-------- 1 root root 0 Oct 21 01:50 hello.txt
#cat > hello.txt
Hello World!
ctrl+d

#cat hello.txt
Hello World!

How come root can still write to this file even though the file is read only..?
# 2  
Old 10-27-2009
To protect against it, you could set this in your profile:

Code:
set -o noclobber

But this prevent overwriting any file with ">" unlsess you use >|

Code:
echo Hello World >| file

# 3  
Old 10-27-2009
Code:
How come root can still write to this file even though the file is read only..?

# 4  
Old 10-27-2009
Quote:
Originally Posted by proactiveaditya
Code:
How come root can still write to this file even though the file is read only..?

Sorry. That bit got lost Smilie

I meant to say:

Root can do anything!

...
# 5  
Old 10-29-2009
if you really want root to do nothing to it, chattr -i

Then nobody will be able to do anything to the file to modify it until the immutable flag is removed.
# 6  
Old 11-21-2009
Quote:
Originally Posted by mark54g
if you really want root to do nothing to it, chattr -i

Then nobody will be able to do anything to the file to modify it until the immutable flag is removed.
A little note. chattr which stands for (change attribute) should be defined as follows:
Code:
chattr +i filename

In this case you won't be able to remove the file(unless you change it to -i) even if your root.

Previous Thread | Next Thread
Test Your Knowledge in Computers #918
Difficulty: Medium
Unix time is a single signed number which increments every millisecond.
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How AS 400 sorting data?

Hi Gurus, I have a requests to sort data based on AS 400 sorting order. below is example: the data is sorted by ascending order. could anybody explain how AS 400 sort data? IMM00007 07918607 1242 423 (3 Replies)
Discussion started by: green_k
3 Replies

2. Shell Programming and Scripting

Wants to create 3 users in 400 servers

I wants to create 3 users and set password for the users in 400 servers. I can run this script without error. If wants to set the password in the same command it is not working. Like that i have to create 3 users #!/usr/bin/ksh for server in `cat /tmp/servers` do echo "servername =... (5 Replies)
Discussion started by: G0kulakrishnan
5 Replies

3. UNIX for Dummies Questions & Answers

First 400,000 lines?

Hi, I need to C&P the first 400,000 lines of a log file into a compressed file using Putty. I already tried emailing myself using mailx (didnt send) and used head -400000 access_log > /tmp/access_log to move the relevant lines into it's own file. And when I tried increasing the scroll back max... (2 Replies)
Discussion started by: Mbohmer
2 Replies

4. AIX

AS/400

Hi everybody, I am learning AS/400 and working on it as a System Administrator. Can anybody please suggest me the best blog site for AS/400....just like Unix.com for Linux / Unix administrator. So that I can get all my answers related to AS/400... thanks in advance, kunal patil :) (0 Replies)
Discussion started by: kunalpatil09
0 Replies

5. UNIX for Dummies Questions & Answers

AS/400

Hi everybody,,,, This is kunal here, I am very new to as/400 and recently started working on it in one of IT company....I am planning to have Certification exam of AS/400. Can anybody please send me the links of different sites where I can have study material of AS/400 and also the details... (1 Reply)
Discussion started by: kunalpatil09
1 Replies

6. UNIX for Dummies Questions & Answers

AS/400

hi everyone,,, Can anybody tell me that whether the AS/400 is an "operating system" or a "Server" ? thanks in advance.... please if possible reply urgently,,,i am waiting..... (8 Replies)
Discussion started by: kunalpatil09
8 Replies

7. Solaris

apache ErrorDocument 400 /cgi-bin/400.cgi

Hi All, Sorry if the question is trivial for you but, I am new to Apache (2.0.63) and am trying to figure out how to display my 400.cgi. Here is what I have in httpd.conf servername testing DocumentRoot "/usr/local/apache2/htdocs" ErrorDocument 400 /cgi-bin/badrequest-400.cgi Here is... (0 Replies)
Discussion started by: afadaghi
0 Replies

8. AIX

IBM AIX on AS/400 Systems

Sry for my beginner question. I didn't find a list with all supported server types for an AIX 5.3 installation. Unfortunately ibm.com page has problems with the sign in so I can't ask in the ibm foum. Will AIX 5.3 run on a 9402, 9404 or 9406 system? Thanks for your help. (3 Replies)
Discussion started by: analyzer
3 Replies

9. Shell Programming and Scripting

connect to as-400 system

it's possible connect to as-400 system to extract file from server and calculate the data (parse the file)???? if possible , how make the operation ??? how shell language /type i use ??? tanks (0 Replies)
Discussion started by: ZINGARO
0 Replies

Featured Tech Videos