SOLVED Unable to change home dir of user

Status
Not open for further replies.

frank3523

Dabbler
Joined
Oct 8, 2011
Messages
33
Hello I have been using freenas for a few years now and it works great.
But I now have a problem with users I create.
I can't change the users home dir.
Every time I create a user freenas creates a home dir with the users name at the end.
It doesn't let me select a different home dir.
I hope anyone can help me with this.
Freenas version I'm running is 9.2.
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
What is happening if you try to select a different folder? Any error message?
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Yes I was trying to do that. I sure hope they will change this in a next release.
I don't think it's going to change, as you can see in the bug report @jkh confirming that this is the desired behavior.
 

RobertM

Cadet
Joined
Jan 4, 2014
Messages
2
jkh,

Thank you for your response to this thread/post.
I'm new to FreeNAS and still have a great deal to learn...

In FreeNAS FTP I was trying to have a common directory ie: "Documents" that could be set as a users home directory for all FTP users but according to the above post(s), this will not be possible.

My question then becomes how do I share a common directory such as "Documents" with all FTP users and only allow them access to that directory?

There must be something really simple that I am missing here...
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
My question then becomes how do I share a common directory such as "Documents" with all FTP users and only allow them access to that directory?
Ah, it is easy to achieve that. Add this to the FTP Settings -> Advanced Mode -> Auxiliary parameters field:

[PANEL]DefaultRoot <path_to_your_Documents_directory>[/PANEL]
All FTP sessions will be restricted to that directory.
 

RobertM

Cadet
Joined
Jan 4, 2014
Messages
2
Thank you Dusan, I can't believe I missed the Auxiliary parameters field!
This works perfectly and also allows me to customize the default root directory for a particular user group.
ie: DefaultRoot <path_to_your_Documents_directory usergroup>

I'd much rather have the flexibility of specifying the users home directory and don't see the purpose of adding the username to the home directory but this is certainly a workaround that accomplishes my end goal.
 

cschappa

Cadet
Joined
Feb 24, 2012
Messages
5
I am able to get this to work using:
/mnt/home/dataset

I need it to work using:
/mnt/home

When I try this, it just goes to the users home directory (dataset).

Is there a way to just make it start at home?

Thank you,
Craig
 

Lars Brandt

Cadet
Joined
May 2, 2014
Messages
8
Ah, it is easy to achieve that. Add this to the FTP Settings -> Advanced Mode -> Auxiliary parameters field:

[PANEL]DefaultRoot <path_to_your_Documents_directory>[/PANEL]
All FTP sessions will be restricted to that directory.


Hi, when I do above the FTP service doesnt start..and I cant start it manually. Console says:
May 2 12:09:21 freenas notifier: freenas.local proftpd[44072]: Fatal: unknown configuration directive 'DefaultRoot</mnt/USBdisk/Filmer>' on line 56 of '/usr/local/etc/proftpd.conf'
May 2 12:09:21 freenas root: /usr/local/etc/rc.d/proftpd: WARNING: failed to start proftpd
May 2 12:09:21 freenas notifier: /usr/local/etc/rc.d/proftpd: WARNING: failed to start proftpd
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
Remove the brackets around the path (< and >). Also the path needs to be separated by a space from DefaultRoot.
 

Lars Brandt

Cadet
Joined
May 2, 2014
Messages
8
Of course.......!! Thanks!! But.....Doesnt really work as easy and good as before...Cant understand why they changed this...
 

Lars Brandt

Cadet
Joined
May 2, 2014
Messages
8
Of course.......!! Thanks!! But.....Doesnt really work as easy and good as before...Cant understand why they changed this...


I have now added three users (mikael, sofie and stina), all given same home directory which Freenas ads their name on the end. I have the above default directory (now without the brackets...) When the users log in they all end up in different directories....mikael ends up in "his" directory which is under root, sofie in "her" directory which us under mnt/usbdisk/films and stina in "her" directory under mnt/usbdisk...all different but seems to be same setup when I compare looking at "view users"....
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
DefaultRoot is only for chrooting users (i.e. for making sure that they cannot access any other directory).

If you want to change the path they start in, you have to set DefaultChdir as well as explained in the ProFTPd documentation which is linked in the FreeNAS manual section for FTP.
 

Lars Brandt

Cadet
Joined
May 2, 2014
Messages
8
So... I put "DefaultChdir /mnt/USBdisk" in the "FTP Settings -> Advanced Mode -> Auxiliary parameters field" and the three users still end up in different directories...I am missing something out I guess, restarting doesnt help, at least not the one time.
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
You need to restart FTP, but that should happen automatically. Any error in the console?

I just tested this on 9.2.1.5, works as expected for me after adding the DefaultChdir directive. Did you change any other settings for the FTP service?
 
Status
Not open for further replies.
Top