You are not logged in.
Pages: 1
I cannot copy file while logged in as root
what is going on?
[root@hostp ~]# cp /etc/resolv.conf_bak /etc/resolv.conf
cp: cannot create regular file `/etc/resolv.conf': Permission denied
[root@hostp ~]# who
who whoami whois
[root@hostp ~]# whoami
root
[root@hostp ~]# ls -l /etc/resolv.conf
-rw-r--r-- 1 root root 50 2009-09-22 11:34 /etc/resolv.conf
Offline
A few possibilities, in decreasing order of likelihood:
- Some process has a lock on that file ("fuser /etc/resolv.conf" to check)
- Your hard drive is full and you're getting strange errors as a result ("df -h" to check)
- `cp' is setuid to someone other than root ("ls -l /bin/cp" to check)
- /etc/resolv.conf is write-protected ("lsattr /etc/resolv.conf" to check)
Offline
Check dmesg for possible hard disk errors.
Offline
post the output of
df -hTl
maybe your /etc/ is a partition mounted read-only, or your entire drive is actually in read-only mode.
also check
ls -l /etc/resolv.conf_bak /etc/resolv.conf
Last edited by quarkup (2009-12-03 18:43:07)
If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.
Offline
damn man you are fast
[root@hostp ~]# lsattr /etc/resolv.conf
----i---------- /etc/resolv.conf
How to role it back ? with chattr I guess
Offline
damn men
I like this forum
Offline
Weird, I wonder how that got set. Anyway, "chattr -i /etc/resolv.conf" as root should do it.
Offline
Pages: 1