![]() |
Permissions problem? - can't access file
What is going on here? I can't access /etc/sshd_config to read or edit it, even as root. (Using debian-live 6.01)
root@debian:/etc# ls -l /etc/ssh* total 132 -rw-r--r-- 1 root root 125749 2010-02-28 01:37 moduli -rw-r--r-- 1 root root 1616 2010-02-28 01:37 ssh_config -rw-r--r-- 1 root root 2453 2010-03-13 17:32 sshd_config -rw------- 1 root root 668 2010-03-13 17:32 ssh_host_dsa_key -rw-r--r-- 1 root root 619 2010-03-13 17:32 ssh_host_dsa_key.pub -rw------- 1 root root 1671 2010-03-13 17:32 ssh_host_rsa_key -rw-r--r-- 1 root root 411 2010-03-13 17:32 ssh_host_rsa_key.pub root@debian:/etc# ls -l /etc/sshd_config ls: cannot access /etc/sshd_config: No such file or directory root@debian:/etc# whoami root I also checked the permissions for the parent file /etc, and root has rwx. Is this something peculiar to the overlay file system used in debian-live, or just another unix gotcha? |
is the filesystem that /etc/ is on mounted read-only?
|
mount shows:
aufs on / type aufs (rw) I think this is the relevant mount point. There are 10 other mounts, but they are all rw too. However, "touch dummy" in /etc gives "permission denied". |
This is a live-cd, no?
Unless you are running this off a USB-stick you are not going to be able to write anything. |
With debian-live you can write to the overlay file system in memory, though to save the changes you must make a snapshot file on USB or elsewhere. Anyway, I can reproduce the problem on Ubuntu 10.10 (full installation, not the live disk) running as a virtual machine in Virtualbox.
|
After discovering that this was a more general problem, I tried googling with the specific filename and found the following:
http://www.linuxquestions.org/questi...s-root-510959/ This seems to answer the question, if only I could understand it. |
try:
Code:
sudo suCode:
chmod +x /etc/sshd_config |
After looking at man chattr, it appears that ext2 has some file permissions outside the nice clean unix tradition. For example
"A file with the 'i' attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be written to the file. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute." The change can apparently be made only with the ext2-specific utility "chattr". Not as nasty as Windows ACL's, but heading in that direction. |
| All times are GMT -5. The time now is 09:28 PM. |