8.3.1 chroot bug?

Status
Not open for further replies.

mikeymc

Cadet
Joined
Apr 2, 2013
Messages
2
Hi all,
I've been a browser for a while and learned a lot just by searching and reading and re-reading all the posts that I needed to read up on to make my Freenas box work.
And I've been playing with 8.3.1 for a while and I came across what appears to be a bug.
When I create chroot directories for each member and try to access it remotely, it requires every directory all the way up to root to be root:wheel and permission 755.
By default, /mnt folder is 775, and every time I change it to 755, it defaults back to 775 after reboot.
And as permission is root:wheel for it to work, each user can't do anything with their home directory as they can't read, write or execute any commands.
I don't think I had this problem with 8.3.0.
It was a fresh install.
Any ideas?

Thanks.
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
I ran into the same issue some days ago after updating to 8.3.1.
Wasn't able to fix it even though rights seemed to be 755 for all folders.

SSH Extra options:
Code:
Match Group sftp
    ChrootDirectory /mnt/tank1/
    ForceCommand internal-sftp
    AllowTcpForwarding no


Error on login (note that its complaining for the root folder /):
Code:
Apr  3 11:11:26 freenas sshd[24127]: fatal: bad ownership or modes for chroot directory component "/"


Directory access rights:
Code:
/# ls -l | grep mnt
drwxr-xr-x   5 root  wheel      512 Mar 21 09:02 mnt/

/mnt# ls -al
total 17
drwxr-xr-x   5 root  wheel     512 Mar 21 09:02 ./
drwxrwxr-x  20 root  wheel     512 Mar 21 08:59 ../
drwxrwxr-x   2 root  operator  512 Mar 21 09:01 .snap/
-rw-rw-r--   1 root  wheel       5 Mar 17 00:22 md_size
drwxr-xr-x   4 root  wheel       4 Mar 23 19:01 tank1/
drwxr-xr-x   2 root  wheel       2 Mar 23 19:19 temp/


I ended up disabling chroot, since it is not very important for me.
 

mikeymc

Cadet
Joined
Apr 2, 2013
Messages
2
After reboot though, /mnt rights went back to 775 for me.
Is there a script I can write that'll force it to become 755 after reboot?
At any rate, I had to go back to 8.3.0 since I have to use chroot.

Thanks.
 

wamsterdam

Cadet
Joined
Apr 3, 2013
Messages
1
Same issue for me. Today I updated from 8.0.1 to 8.3.1 and suddenly my users could no longer connect remotely. The GUI shows me permissions for the folder /mnt is set to 755, but putty shows me 775. For now I changed it manually to 755, but at the next reboot that will be reset. I checked and doublechecked. While this fixed by the programming team, would a cronjob running at boot temporary fix this? Like so:

Code:
@reboot chmod 755 /mnt


TIA,
Wouter
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
While this fixed by the programming team, would a cronjob running at boot temporary fix this? Like so:

Code:
@reboot chmod 755 /mnt


TIA,
Wouter

I was thinking exactly this. But I'd setup a cronjob to run every 5 minutes or so. That way if @reboot doesn't fix it, within 5 minutes it would be fixed. Also, if whatever is responsible for the permissions change triggers again you'll never have to wait more than 5 minutes for it to get fixed. It's not like chmod is CPU intensive so running it every 5 minutes is a bad thing. :P
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Not a clue.. since this issue is from June 2013...
 
Status
Not open for further replies.
Top