# Permissions not working?



## bsus (Oct 3, 2011)

Hi,
I have a permission issue with my home-dirs.

A home-dir of any user should only be readable for the user himself. When looking after the permissions this also should work so. But I can read with another user the data of the home dir via shell:

```
drwxr-xr-x  43 <user-a>    <group-a>     66 Oct  3 13:58 <user-a>
<user-b>@freebsd ~ $ ls /usr/home/<user-a>
<files>
```

Shouldn't the permissions forbit other users to look into my user-dir?

Regards


----------



## Beastie (Oct 3, 2011)

Well, if you let the rest of the user's Group as well as the rest of the World "execute" the directory, it means they can (at the very least) list its contents.
You probably want to have a *700* permission or so.
[cmd=""]chmod 700 directory[/cmd]


----------



## bsus (Oct 3, 2011)

Ah ok,
Hmm I was disturbed that I can read by default even data in the dirs...
So I could cat any file by default.
Can I change the default options over chsh?

Regards


----------



## Alt (Oct 4, 2011)

"r" means a group can "read" directory, so goup can list files with `ls`. If you remove "r" permission then group cannot get files list, but can read a file if he have exact filename (and ofc, permissions on file itself)
"x" means a group can "chdir" to directory, including access to files inside at all


----------



## SirDice (Oct 4, 2011)

bsus said:
			
		

> Can I change the default options over chsh?


This has nothing to do with the data in /etc/passwd, which is what chsh(1) modifies. What you're probably looking for is umask(1). This can also be set using a login class, see login.conf(5).


----------



## fluca1978 (Oct 4, 2011)

r is for listing the directory content, x is for entering the directory (e.g., via chdir or referencing a file with the path).


----------

