Saturday, December 16, 2017

ProFTPD

sudo apt-get install xinetd telnetd
 $ telnet localhost 21
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused


UFW Firewall setup for ftp ports 20/21

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-16-04

Just use webmin to setup ProFTPD

https://doxfer.webmin.com/Webmin/ProFTPD_Server 

################################################
# Deprecated
################################################

Make an FTP user

useradd madmax -m -s /bin/bash

To change a users password you need to have sudo privileges yourself.
sudo passwd username will change the password for the 'username' you want to change.

Make an ssh key for the user
sudo -u madmax ssh-keygen -t rsa
 
Hit enter twice to confirm key creation without password. 
Next let's convert it's key into RFC4716 format and put it into the proftpd folder:
ssh-keygen -e -f ~madmax/.ssh/id_rsa.pub | tee /etc/proftpd/authorized_keys/madmax  

ProFTPD

http://www.proftpd.org/docs/howto/Debugging.html

ProFTPD installation with public keys

https://www.devops.zone/ftp-server/installing-proftpd-with-public-key-authentication-on-ubuntu-16-04/

As a security measure it is actually a good idea to comment the following line from /etc/ssh/sshd_config
 
Subsystem sftp /usr/lib/openssh/sftp-server

and restart SSH:  

sudo service ssh restart


Trouble shooting
http://www.proftpd.org/docs/faq/linked/faq-ch4.html#AEN258

sudo proftpd -nd10

http://www.proftpd.org/docs/contrib/mod_sftp.html

Limit directory access

http://www.proftpd.org/docs/howto/Chroot.html

Restricting Users' Directories
One of the most common questions for new users of ProFTPD is "How do I restrict my users to only certain directories?" or, phrased another way, "How can I put my users in a chroot jail?" As a common question, it definitely has a place in the FAQ. Many users, I fear, do not read the FAQ carefully, and so miss that section. The answer is ProFTPD's DefaultRoot configuration directive, which accomplishes this functionality by using the chroot(2) function.
This configuration directive may appear in the , , and the "server config" (meaning not in any or sections) configuration contexts. The most common configuration requested is to restrict users to their home directories, which can be done simply by adding the following line to your proftpd.conf:

  DefaultRoot ~
 
 

Installing ProFTPd with Public Key Authentication on Ubuntu 16.04

 
https://www.digitalocean.com/community/tutorials/how-to-configure-proftpd-to-use-sftp-instead-of-ftp 
 
https://www.devops.zone/ftp-server/installing-proftpd-with-public-key-authentication-on-ubuntu-16-04/ 

 $ sudo ssh-keygen -e -f ~ftp_user/.ssh/id_rsa.pub > t

$ sudo mv t /etc/proftpd/authorized_keys/ftp_user

$ sudo ls /etc/proftpd/authorized_keys/ftp_user
/etc/proftpd/authorized_keys/ftp_user

$ sudo  service proftpd restart

https://extremeshok.com/4974/ubuntu-lts-ultimate-ftp-server-proftpd-mariadb-mysql-with-ftp-and-sftp-scp-quota-and-bandwidth-accounting/

Check SFTP installation
https://www.digitalocean.com/community/tutorials/how-to-configure-proftpd-to-use-sftp-instead-of-ftp 

Use filezilla

Use the command line

 

Couldn't read packet: Connection reset by peer

https://unix.stackexchange.com/questions/274995/sftp-ssh-couldnt-read-packet-connection-reset-by-peer





No comments:

Post a Comment