When I first started using Linux... back in the stone age. You installed sftp servers on everything.
It was really the most practical way to transfer files over the network at the time. Otherwise you set up a web server
and make download links for the files you wanted to transfer. That got old in a hurry.
If I remember a lot of ftp/sftp servers were proftpd, vsftpd, and cerebus ftp. I think there were probably a few others.
ssl wasn't really much of a thing yet, ftp was much more popular than sftp. ssh/scp didn't really exist for the most part.
For a long time, probably about 15 years or so. I only used scp. It was a bit of hassle to use and didn't have all the features of sftp, but
it was included in ssh, and I didn't have to setup a ftp server. Around 2007 or so ther was big security hole in vsftp and proftpd, so we quit
using them in favor of scp.
Funny how things go in circles sometimes. I think it was back in 2021, not so long ago really, some security holes were found in scp.
A lot of this was related more to openSSL, rather than ssh/scp directly. TLS start taking over the world about that time.
When ssh 9. was released, it started including sftp capability. For some distro's it was enabled by default. For other distro's you had to
manually enable it.
This is probably already enabled in your disto, but if not, edit the following file.
/etc/ssh/sshd_config
Add or uncomment the following line
then restart ssh.
The major disadvantage of scp, was you had to know the path and name of the file to download in advance. You couldn't login
and use the "cd" and "ls" commands with scp.
Example:
Using sftp is slightly different, and usually easier. You use GET to download
To upload is similar except you use "put" to upload.
If you've been using scp, not to worry... in reality if you have ssh 9.x or newer installed, you're really using sftp in the background.
scp username@hostname:/path/to/file . equals sftp username@hostname get /path/to/filename
The scp commands really just wraps sftp in the background.
It was really the most practical way to transfer files over the network at the time. Otherwise you set up a web server
and make download links for the files you wanted to transfer. That got old in a hurry.
If I remember a lot of ftp/sftp servers were proftpd, vsftpd, and cerebus ftp. I think there were probably a few others.
ssl wasn't really much of a thing yet, ftp was much more popular than sftp. ssh/scp didn't really exist for the most part.
For a long time, probably about 15 years or so. I only used scp. It was a bit of hassle to use and didn't have all the features of sftp, but
it was included in ssh, and I didn't have to setup a ftp server. Around 2007 or so ther was big security hole in vsftp and proftpd, so we quit
using them in favor of scp.
Funny how things go in circles sometimes. I think it was back in 2021, not so long ago really, some security holes were found in scp.
A lot of this was related more to openSSL, rather than ssh/scp directly. TLS start taking over the world about that time.
When ssh 9. was released, it started including sftp capability. For some distro's it was enabled by default. For other distro's you had to
manually enable it.
This is probably already enabled in your disto, but if not, edit the following file.
/etc/ssh/sshd_config
Add or uncomment the following line
Code:
Subsystem sftp /usr/lib/openssh/sftp-server
then restart ssh.
Code:
systemctl restart ssh
The major disadvantage of scp, was you had to know the path and name of the file to download in advance. You couldn't login
and use the "cd" and "ls" commands with scp.
Example:
Code:
scp username@hostname:/path/to/myfile.txt .
Using sftp is slightly different, and usually easier. You use GET to download
Code:
sftp username@hostname
ls
cd /home/user/Downloads
get myFavorteDistro-latest.iso
To upload is similar except you use "put" to upload.
Code:
sftp username@hostname
ls
cd /home/user/Downloads
put mySecondFavorteDistro-latest.iso
If you've been using scp, not to worry... in reality if you have ssh 9.x or newer installed, you're really using sftp in the background.
scp username@hostname:/path/to/file . equals sftp username@hostname get /path/to/filename
The scp commands really just wraps sftp in the background.

