Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to set up and configure an FTP server in Linux?
- ***********************************************************
- Telegram post: https://t.me/efxtv/3257
- Telegram channel: https://t.me/efxtv
- ***********************************************************
- FTP (file transfer protocol) is an internet protocol that is used for transferring files between client and server over the internet or a computer network. It is similar to other internet protocols like SMTP which is used for emails and HTTP which is used for websites.
- Step 1: Install FTP server
- $ sudo apt install vsftpd
- Step 2: Start the FTP server
- $ sudo systemctl enable vsftpd
- $ sudo service start vsftpd
- $ sudo systemctl enable --now vsftpd
- Step 2: Configure Firewall
- $ sudo ufw allow 20/tcp
- $ sudo ufw allow 21/tcp
- $ sudo ufw allow 990/tcp
- $ sudo ufw allow 5000:10000/tcp
- Step 3: Create ftpuser
- $ sudo adduser ftpuser
- Step 4: Configure user
- $ sudo nano /etc/ssh/sshd_config
- ...
- DenyUsers ftpuser
- ...
- Step 5: Restart sshd
- $ sudo systemctl restart sshd
- $ sudo mkdir /ftp
- $ sudo chown adminuser /ftp
- Step 6: Edit config file
- $ sudo nano /etc/vsftpd.conf
- ...
- anonymous_enable=NO
- local_enable=YES
- write_enable=YES
- pasv_min_port=5000
- pasv_max_port=10000
- local_root=/ftp
- chroot_local_user=YES
- chroot_list_enable=YES
- chroot_list_file=/etc/vsftpd.chroot_list
- allow_writeable_chroot=YES
- local_umask=0002
- ...
- Step 7: Now, we need to create that list file
- $ sudo touch /etc/vsftpd.chroot_list
- $ sudo nano /etc/vsftpd.chroot_list
- Step 8: Restart our vsftpd server
- $ sudo systemctl restart --now vsftpd
- $ sudo systemctl restart --now vsftpd
- Most used FTP server commands
- π΄ connect $ ftp -p 21 192.168.***
- π΄ get filename- download the specified file
- π΄ put filename- uploads the specified file
- π΄ pwd- print the current working directory
- π΄ cwd- change working directory
- π΄ dele- delete the specified file
- π΄ cdup- change to the parent directory
- π΄ help- displays help information
- π΄ cd- change the working directory
- π΄ bye- end FTP session
- ββββββββββββββββββββΒ Β
- πΊ t.me/efxtv πΊ
- ββββββββββββββββββββ
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement