This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
account [2016/10/30 08:58] alex |
account [2016/10/30 09:01] (current) alex [Creating an Account] |
||
---|---|---|---|
Line 8: | Line 8: | ||
root@marmot:~# [edit /etc/fstab to mount new user space] | root@marmot:~# [edit /etc/fstab to mount new user space] | ||
root@marmot:~# mount /home/$NEW_USER | root@marmot:~# mount /home/$NEW_USER | ||
- | root@marmot:~# useradd -k -G users,wormnet-shell -s /bin/bash $NEW_USER | + | root@marmot:~# useradd -G users,wormnet-shell -s /bin/bash $NEW_USER |
root@marmot:~# passwd $NEW_USER | root@marmot:~# passwd $NEW_USER | ||
root@marmot:~# mkdir /home/$NEW_USER/.ssh | root@marmot:~# mkdir /home/$NEW_USER/.ssh | ||
root@marmot:~# echo "ssh-rsa AAAB3...KD0pw== fred@foobar" > /home/$NEW_USER/.ssh/authorized_keys | root@marmot:~# echo "ssh-rsa AAAB3...KD0pw== fred@foobar" > /home/$NEW_USER/.ssh/authorized_keys | ||
- | root@marmot:~# chown -R $NEW_USER:$NEW_USER /home/$NEW_USER/.ssh/ | + | root@marmot:~# tar cC /etc/skel . | tar xC /home/$NEW_USER |
+ | root@marmot:~# chown -R $NEW_USER:$NEW_USER /home/$NEW_USER | ||
+ | root@marmot:~# chmod -R og-r-w-x /home/$NEW_USER | ||
==== Restricting to Just sftp/scp ==== | ==== Restricting to Just sftp/scp ==== | ||
If you make the users account use the shell ''/usr/bin/rssh'' and edit ''/etc/rssh.conf'' then you can create accounts that can only upload/download files rather than have a full shell - although you will still need to add them to the 'wormnet-shell' group. | If you make the users account use the shell ''/usr/bin/rssh'' and edit ''/etc/rssh.conf'' then you can create accounts that can only upload/download files rather than have a full shell - although you will still need to add them to the 'wormnet-shell' group. |