Project

General

Profile

Bug #28518

Set permissions correctly on user's home directory

Added by Simon Choucroun about 1 year ago. Updated about 1 year ago.

Status:
Done
Priority:
Regression
Assignee:
Brandon Schneider
Category:
Middleware
Target version:
Seen in:
Severity:
High
Reason for Closing:
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

SSH user with bash account gets permission denied when logging in due to his home dir being owned by root/wheel

Seems to be the same issue as bug#27512 however it does not seem resolved in 11.1-U1


Related issues

Related to FreeNAS - Bug #27512: Fix permissions on user's SSH directory when creating the user accountResolved2017-12-29

Associated revisions

Revision 9ba043c5 (diff)
Added by Brandon Schneider about 1 year ago

fix(middlewared): Chown existing user dataset and files

They may be reusing a dataset unwittingly, or purposely. Regardless, set the correct owner.

Ticket: #28518

Revision 16af25a2 (diff)
Added by Brandon Schneider about 1 year ago

fix(middlewared): Chown existing user dataset and files

They may be reusing a dataset unwittingly, or purposely. Regardless, set the correct owner.

Ticket: #28518

Revision 80d3ccb4 (diff)
Added by Brandon Schneider about 1 year ago

[MASTER] fix(middlewared): Chown existing user dataset and files (#863)

fix(middlewared): Chown existing user dataset/dir

They may be reusing a dataset unwittingly, or purposely. Regardless, set the correct owner.

Ticket: #28518

History

#1 Updated by Dru Lavigne about 1 year ago

  • Related to Bug #27512: Fix permissions on user's SSH directory when creating the user account added

#2 Updated by Dru Lavigne about 1 year ago

  • Private changed from No to Yes

Simon: please attach a debug (System -> Advanced -> Save Debug) that was created after reproducing the error.

#3 Updated by Simon Choucroun about 1 year ago

  • File debug-vbk1-20180215094933.tgz added

Dru Lavigne wrote:

Simon: please attach a debug (System -> Advanced -> Save Debug) that was created after reproducing the error.

Attached

#4 Updated by Dru Lavigne about 1 year ago

  • Assignee changed from Release Council to William Grzybowski
  • Target version set to 11.2-RC2

#5 Updated by William Grzybowski about 1 year ago

  • Status changed from Not Started to Blocked
  • Reason for Blocked set to Waiting for feedback

Did you create that user on 11.1 or 11.1-U1?

#6 Updated by Simon Choucroun about 1 year ago

William Grzybowski wrote:

Did you create that user on 11.1 or 11.1-U1?

11.1-U1, this is a fresh installed from the ISO image fetched at this link about 10 hours ago now https://download.freenas.org/11/latest/x64/FreeNAS-11.1-U1.iso

#7 Updated by William Grzybowski about 1 year ago

Simon Choucroun wrote:

William Grzybowski wrote:

Did you create that user on 11.1 or 11.1-U1?

11.1-U1, this is a fresh installed from the ISO image fetched at this link about 10 hours ago now https://download.freenas.org/11/latest/x64/FreeNAS-11.1-U1.iso

Are you sure the user directory did not already exist?

Can you paste "ls -la" of the home dir?

#8 Updated by Simon Choucroun about 1 year ago

William Grzybowski wrote:

Simon Choucroun wrote:

William Grzybowski wrote:

Did you create that user on 11.1 or 11.1-U1?

11.1-U1, this is a fresh installed from the ISO image fetched at this link about 10 hours ago now https://download.freenas.org/11/latest/x64/FreeNAS-11.1-U1.iso

Are you sure the user directory did not already exist?

Can you paste "ls -la" of the home dir?

Hi William,

The folder is indeed created automatically before the user when i create the dataset.

here is the steps i usually take.

1. Create Dataset
2. Create user and assign it dataset as home dir with bash shell and password
3. Login via ssh with said user

In this case, step 3 fails i assume because of some permission issue

*outside homedir:

*root@vbk1:/mnt/backup # ls -la
total 42
drwxr-xr-x  6 root  wheel    6 Feb 15 10:23 .
drwxr-xr-x  3 root  wheel  128 Feb 15 01:55 ..
drwxr-xr-x  2 www   www      2 Feb 15 09:44 .freenas
drwxr-xr-x  2 root  wheel    2 Feb 15 02:11 jails
drwxr-xr-x  3 root  wheel   11 Feb 15 02:06 dedi123
drwxr-xr-x  3 root  wheel   11 Feb 15 09:48 user1

Inside homedir:

root@vbk1:/mnt/backup/user1 # ls -la
total 64
drwxr-xr-x  3 root   wheel   11 Feb 15 09:48 .
drwxr-xr-x  6 root   wheel    6 Feb 15 10:23 ..
-rw-r--r--  1 user1  user1  983 Feb 15 09:48 .cshrc
-rw-r--r--  1 user1  user1  182 Feb 15 09:48 .login
-rw-r--r--  1 user1  user1   91 Feb 15 09:48 .login_conf
-rw-r--r--  1 user1  user1  301 Feb 15 09:48 .mail_aliases
-rw-r--r--  1 user1  user1  267 Feb 15 09:48 .mailrc
-rw-r--r--  1 user1  user1  728 Feb 15 09:48 .profile
-rw-r--r--  1 user1  user1  212 Feb 15 09:48 .rhosts
-rw-r--r--  1 user1  user1  780 Feb 15 09:48 .shrc
drwx------  2 user1  user1    3 Feb 15 09:48 .ssh

#9 Updated by Dru Lavigne about 1 year ago

  • Target version changed from 11.2-RC2 to 11.1-U2

#10 Updated by William Grzybowski about 1 year ago

  • Status changed from Blocked to Not Started
  • Assignee changed from William Grzybowski to Brandon Schneider
  • Priority changed from Important to Regression
  • Reason for Blocked deleted (Waiting for feedback)

I see, so the problem here is that the directory already exists and is not created by the UI.

It should chown the dir nevertheless.

--

Brandon, could you please try to get this in before Friday morning (EST)?

If not change it to 11.2.

Thanks!

#11 Updated by Simon Choucroun about 1 year ago

William Grzybowski wrote:

I see, so the problem here is that the directory already exists and is not created by the UI.

It should chown the dir nevertheless.

--

Brandon, could you please try to get this in before Friday morning (EST)?

If not change it to 11.2.

Thanks!

Thanks for confirming the issue. I will swtich back this machine to 11.0 U4 in the meantime!

#12 Updated by Brandon Schneider about 1 year ago

  • Status changed from Not Started to In Progress

#13 Updated by Dru Lavigne about 1 year ago

  • Subject changed from SSH user with bash account gets permission denied when logging in due to his home dir being owneed by root/wheel to Set permissions correctly on user's home directory
  • Needs Doc changed from Yes to No

#14 Updated by William Grzybowski about 1 year ago

  • Status changed from In Progress to Done

#15 Updated by Dru Lavigne about 1 year ago

  • Needs Merging changed from Yes to No

#16 Updated by Dru Lavigne about 1 year ago

  • File deleted (debug-vbk1-20180215094933.tgz)

#17 Updated by Dru Lavigne about 1 year ago

  • Private changed from Yes to No

Also available in: Atom PDF