Taken from FreeNAS forums:
What you need to do to customize your server for passwordless authentication:
- From WebGUI|Advanced|Execute command or shell
- protect the /mnt directory by setting the mode to 755(we don't want users to write on /mnt, that can fill up the RAM disk and crash the system.
You must change the mod as startup command, after each reboot.
Code:
chmod 755 /mnt
- For your safety change the mode for each mount, or at least one "mount".
Code:
chmod 755 /mnt/mount
- Create the user(A) home directory /mnt/mount/userA
Code:
mkdir /mnt/mount/userAdir
- Make userA the owner of his home directory
Code:
chown userA /mnt/mount/userAdir
- Secure userA home directory
Code:
chmod 700 /mnt/mount/userAdir
- protect the /mnt directory by setting the mode to 755(we don't want users to write on /mnt, that can fill up the RAM disk and crash the system.
- Set userA home directory on WebGUI|Access|Users|Edit|Home directory to point to /mnt/mount/userAdir
- From your remote client(ssh/PuTTy)
- Check if home directory is set corectly for userA. The output should be /mnt/mount/userAdir
Code:
ssh -p 22 userA@FreeNASip 'pwd'
- Create the .ssh directory
Code:
ssh -p 22 userA@FreeNASip 'mkdir .ssh'
- Upload your id_rsa.pub or id_dsa.pub to remote .ssh directory.
Code:
cat id_rsa.pub | ssh -p 22 userA@FreeNASip 'cat >> .ssh/authorized_keys'
- Change the .ssh dir mode
Code:
ssh -p 22 userA@FreeNASip 'chmod -R 700 ~/.ssh'
- Check if home directory is set corectly for userA. The output should be /mnt/mount/userAdir
- Now try to login passwordless.
Step C-3 needs to be "cat id_rsa.pub | ssh -p 22 userA@FreeNASip 'cat >> ~/.ssh/authorized_keys'
ReplyDeleteat least that's what worked for me. Thanks for the post helped a bunch!!
Thanks, you saved my day
ReplyDelete