54
votes

i'm doing a dir listing in my .ssh home dir which gives me a strange result:

ls -lsa .ssh/
total 0
? ?--------- ? ? ? ?            ? . ·
? ?--------- ? ? ? ?            ? .. ·
? ?--------- ? ? ? ?            ? authorized_keys ·

The weird thing is, that this only happens for one user and only in this specific directory. If I do the ls after a su -l, everything works as expected. Another strange thing is, that my xterm shows the dir listing in a red blinking font! Any ideas what's causing this to happen?

thx!

Edit:
Here is the dir listing as root:

ls -lsa
total 52
4 drw-------  2 sdd sdd 4096 Feb 10 15:57 .
4 drwx------ 16 sdd sdd 4096 Feb 10 15:57 ..
4 -rw-------  1 sdd sdd 1628 Feb 10 15:57 authorized_keys

I'm using ext3.

Edit2:
Thx for the answers, but i still get this:

chmod -R 600 /home/sdd/.ssh
ls -lsan _ssh.old/
total 0
? ?--------- ? ? ? ?            ? .
? ?--------- ? ? ? ?            ? ..
? ?--------- ? ? ? ?            ? authorized_keys
1
Can you post the output of ls -lah once root .. and tell us what file system you are using?Tim Post
Does this user have a weird locale or weird terminal font?gnud
no it's a "normal" font, i.e. no UTF8 stuff or anythingSDD
Could you update edit2? It doesn't make any sense, you're chmodding with the wrong mode (no execute) and then listing a different dir...wds

1 Answers

101
votes

That happens when the user can't do a stat() on the files (which requires execute permissions), but can read the directory entries (which requires read access on the directory). So you get a list of files in the directory, but can't get any information on the files because they can't be read. :) If you have a directory which has read permission but not execute, you'll see this. Someone probably tried to protect the .ssh directory incorrectly - it should be "chmod 0700 .ssh/" and owned by the user which owns the homedir. More than likely, someone was following instructions for securing a .ssh file but applied it to a .ssh directory. :)

If you do a chmod 0600 or 0400 on any directory, you can easily reproduce this behavior. Add execute permission to the dir, and it'll work fine.