Modify the user to add them to the new group you created ~]# usermod -aG sftpusers user1Ĭhange permission for the users chrooted "home" directory only. Server setup for sftp onlyĬreate a new group to add all your jailed chroot users on the server ~]# groupadd sftpusersĬreate a common directory for all of your jailed chroot users ~]# mkdir /sftpĬreate a subdirectory for each individual user that you want to chroot ~]# mkdir /sftp/user1Ĭreate the "home" directory for the user ~]# mkdir /sftp/user1/home To chroot user1 and keep them jailed and locked down to a specified directory. Without making any changes, user1 has full access and can ssh or sftp and change to any directory. Verify that your sftp connection works without a password prompt ~]$ sftp to server Configuring a SFTP server with chroot users and ssh keysĬreate the user on the server ~]# useradd ~]# passwd user1Ĭopy the ssh key from the client to the server (The user does not have to exist on the client) ~]$ ssh-copy-id the ssh key works correctly from the client ~]$ ssh ~]$ exit.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |