LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-09-2011, 09:34 AM   #1
carolus
Member
 
Registered: Feb 2008
Posts: 45

Rep: Reputation: 15
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?
 
Old 05-09-2011, 10:00 AM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
is the filesystem that /etc/ is on mounted read-only?
 
Old 05-09-2011, 11:18 AM   #3
carolus
Member
 
Registered: Feb 2008
Posts: 45

Original Poster
Rep: Reputation: 15
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".
 
Old 05-09-2011, 11:25 AM   #4
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
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.
 
Old 05-09-2011, 12:05 PM   #5
carolus
Member
 
Registered: Feb 2008
Posts: 45

Original Poster
Rep: Reputation: 15
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.
 
Old 05-09-2011, 01:57 PM   #6
carolus
Member
 
Registered: Feb 2008
Posts: 45

Original Poster
Rep: Reputation: 15
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.
 
Old 05-09-2011, 02:23 PM   #7
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Rep: Reputation: 0
try:
Code:
sudo su
chmod x+r /etc/sshd_config
pico /etc/sshd_config
or
Code:
chmod +x /etc/sshd_config
chmod +r /etc/sshd_config
pico /etc/sshd_config
 
Old 05-09-2011, 02:33 PM   #8
carolus
Member
 
Registered: Feb 2008
Posts: 45

Original Poster
Rep: Reputation: 15
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.
 
  


Reply

Tags
debian, live, permissions, sshdconfig


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
file access/permissions rblampain Programming 2 01-18-2006 12:11 AM
fat32 file access permissions wwnexc Linux - Security 2 09-05-2005 10:04 PM
File access permissions gumbald Slackware 4 10-22-2004 08:23 PM
Permissions, File, Directory access tHcnunz Linux - Newbie 3 03-26-2004 09:25 AM
Samba file access permissions bryanl Linux - Networking 0 01-04-2004 05:16 PM


All times are GMT -5. The time now is 02:51 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration