We’ve shown you how to install and configure a secure and fast FTP server on your Raspberry Pi system. Use the same command to change the shell of all users you want to give only FTP access. To disable shell access, create a new shell that will simply print a message telling the user that their account is limited to FTP access only.Ĭreate the /bin/ftponly shell and make it executable: echo -e '#!/bin/sh\necho "This account is limited to FTP access only."' | sudo tee -a /bin/ftponly sudo chmod a x /bin/ftponlyĪppend the new shell to the list of valid shells in the /etc/shells file: echo "/bin/ftponly" | sudo tee -a /etc/shellsĬhange the user shell to /bin/ftponly: sudo usermod newftpuser -s /bin/ftponly : sudo mkdir -p /home/newftpuser/ftp/upload sudo chmod 550 /home/newftpuser/ftp sudo chmod 750 /home/newftpuser/ftp/upload sudo chown -R newftpuser: /home/newftpuser/ftpĪs discussed in the previous section, the user will be able to upload files to the ftp/upload directory.Īt this point, your FTP server is fully functional, and you should be able to connect to your server using any FTP client such as FileZillaīy default, when creating a user, if not explicitly specified the user will have SSH access to the device. If you set allow_writeable_chroot=YES in your configuration file, skip the 3rd step.Ĭreate a new user named newftpuser: sudo adduser newftpuserĪdd the user to the allowed FTP users list: echo "newftpuser" | sudo tee -a /etc/er_listĬreate the FTP directory tree and set the correct permissions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |