Please little help on ssh 2nd user setup

Status
Not open for further replies.

idd

Cadet
Joined
Sep 22, 2011
Messages
7
Can someone please help me in setting up a second user on ssh
this what i have done so far

User ID 1002
Username tom
Primary Group ID Operater
Home Directory /mnt/HD1
Shell sh
Full Name tom
E-mail
Disable logins


My question is how can i stop him seeing the Root Directory all i want him to do is access HD1 and nothing else please if someone can shed some light its driving me crazy

thank you

idd4
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Don't put him in the group "operator", make another group or assign him to the group that you have set the /mnt/HD1 directory to, as long as that group doesn't also have access to the root directory.
 

idd

Cadet
Joined
Sep 22, 2011
Messages
7
Don't put him in the group "operator", make another group or assign him to the group that you have set the /mnt/HD1 directory to, as long as that group doesn't also have access to the root directory.

thank you for quick reply should i select Group "tom" or what would you suggest ?
 

Durkatlon

Patron
Joined
Aug 19, 2011
Messages
414
This is probably not possible. You want this user to login via ssh, therefore he needs to see the root directory, or more specifically some of the subdirectories underneath. Otherwise the user could not load his shell or execute any commands.

The proper way to restrict access to a user in such a scenario might be to put him in a "chroot jail". I don't know if anyone has tried to do this on FreeNAS8. It certainly isn't supported out of the box.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
This is probably not possible. You want this user to login via ssh, therefore he needs to see the root directory, or more specifically some of the subdirectories underneath. Otherwise the user could not load his shell or execute any commands.

Durk, I understand what you are suggesting, but with the proper permissions it is completely possible.

@idd, if you are in the 'HD1' directory, do an 'ls -ld .' this will show you the owner and group of that directory. Try adding Tom to that group and see if that helps. As Durk suggested, the parent directory permissions can make a difference. You would also need to do an 'ls -ld /mnt' to see what the owner/group was and make sure the group of /mnt is not the same as 'HD1'.

Durk, maybe at some point you & I could put together a video(s) about permissions since it seems to be a recurring topic that a lot of people don't understand. I would actually be surprised if there wasn't something on Youtube already.
 
Status
Not open for further replies.
Top