Pure-FTPd: install valid SSL certificate / solve untrusted localhost certificate problem on CentOS 7

If you installed Pure-FTPD on your CentOS 7 machine and trying to install SSL certificate on it, chances are that you added your pem file to “/etc/ssl/private/”. I installed valid certificate in this directory and still getting untrusted warning for localhost certificate. Later, I found out that this path is wrong and self signed certificate was being used. Right path on CentOS 7 is “/etc/pki/pure-ftpd/”.

Here is how to do it right on Centos.

  • Create pem certificate that contains your key, crt and intermediate all in one file – pure-ftpd.pem
  • Move this certificate to /etc/pki/pure-ftpd/ as this is the right directory on CentOS.
  • In your pure-ftpd.conf, set TLS to 2.
  • Enable PassivePortRange from 30000 – 65000.
  • Restart pure-ftpd.

It should work.

SFTP: Command failed

If you try to connect via SFTP with some FTP/SFTP client and you are getting error “Command failed”, you’re sftp-server path in sshd_conf is wrong.

Open your sshd_config file and edit sftp-server path accordingly to your OS.

Ubuntu:

Subsystem sftp  /usr/lib/openssh/sftp-server

CentOS:

Subsystem sftp /usr/libexec/openssh/sftp-server

Restart your ssh and it should work.

FTP file transfer from command line with wget

Sometimes you have a lot of files to transfer and no rsync, only FTP. You don’t want to sit in front of the computer and waiting for files to transfer. If you have access to command line, there is a simple solution on how to transfer all your files through FTP with wget. Once transfer is started you don’t want to close terminal session as you would cancel transfer also. Luckily there is great piece of software named screen. So, you start a new screen session by typing command screen, and run command below. Then you can detach from that screen session with pressing CTRL + A + D. This way file transfer will continue to transfer in background. You can even shut down your computer. When you want to see if all is transfered, you can just attach screen session back with command screen -x.

So in screen, just run this:

wget -m ftp://username:password@ftp.hostname.com

© 2024 geegkytuts.net
Hosted by SIEL


About author