# SSH does not work with users' home set to 750



## freezr (Jun 13, 2022)

Dear all,

to begin I'd like to clarify that I am not a professional, I am just passionate about it, and I am doing all of this for hobby and fun!

On my pet VPS to prevent people lurking in the other home directories I setup each users <homedir> with permissions 750, unfortunately this prevented some authorized users (included myself) to SSH into the server. Eventually to reinstate SSH I had to revert the permissions to 755.

Did I use wrong permissions? Is there any particular setup that I have to specify into sshd_conf?

Thanks in advance,

F.


----------



## SirDice (Jun 13, 2022)

It's not the 0750 permissions on the home directory. That works just fine.


```
root@fbsd-test:/home # ls -al
total 24
drwxr-xr-x   3 root  wheel  512 Dec 27  2020 .
drwxr-xr-x  16 root  wheel  512 Apr 19  2021 ..
drwxr-x---   4 dice  dice   512 Jun 13 17:46 dice
```


```
dice@maelcum:~ % ssh fbsd-test
(dice@fbsd-test.dicelan.home) Password for dice@fbsd-test.dicelan.home:
Last login: Mon Jun 13 17:46:44 2022 from maelcum.dicelan.home
FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC

Welcome to FreeBSD!
...
```


----------



## VladiBG (Jun 13, 2022)

See here for files and ssh key (~/.ssh/id_rsa)






						ssh(1)
					






					www.freebsd.org


----------



## freezr (Jun 13, 2022)

Ok... The curse of Pebkac... 

I changed the permit again at 750 and to be sure rebooted the VPS and now it works... 


```
drwxr-xr-x   4 root    wheel   512 Jun 10 15:55 .
drwxr-xr-x  15 root    wheel   512 May 25 18:26 ..
drwxr-x---   6 freezr  freezr   512 Jun  5 02:04 freezr
```


----------



## SirDice (Jun 13, 2022)

How did you change those permissions? Did you do a `chmod -R 750 <homedir>`? Because that would set _everything_ to 750 in the directory too. This would also mark plain _files_ as executables. Usually not what you want happening.


----------



## freezr (Jun 13, 2022)

Ok to be honest... I tried to access from my OpenBSD machine and with permissions set to 750 I couldn't, while now I tried to access from FreeBSD...

Maybe the issue is within OpenBSD...


----------



## freezr (Jun 13, 2022)

SirDice said:


> How did you change those permissions? Did you do a `chmod -R 750 <homedir>`? Because that would set _everything_ to 750 in the directory too. This would also mark plain _files_ as executables. Usually not what you want happening.



I did `chmod 750 user_homedir` but now I think it is an issue that belong to OpenBSD...


----------



## drhowarddrfine (Jun 13, 2022)

Note that on Unix and FreeBSD--and Linux, too--they are "directories" and not the Windows concept of "folders" which is not the same thing.


----------



## freezr (Jun 13, 2022)

drhowarddrfine said:


> Note that on Unix and FreeBSD--and Linux, too--they are "directories" and not the Windows concept of "folders" which is not the same thing.



I apology... Bad habit reinforced by using Window all the day at work...


----------

