Daily Archives: March 7, 2015

Alternatives to FTP

One server I have is fairly low on resources, so I opted not to run FTP. It would just mean yet another service that would have to run on a low RAM unit. So to move files to and from this server I use scp or sftp from Linux and WinSCP from Windows.

SCP Example

These examples assumes you can SSH into your server!

Using a FQDN

The following example shows downloading a directories content from a remote server using a fully qualified domain name.

 scp -r username@serverlocation.com:/home/username/dir /home/username/dir

Using a IP address

On the local network in this example using an ip address, copying remote to local.

 scp -r user@192.168.1.101:/home/user/fswebcam /home/user/fswebcam

Example of uploading a single file to a remote server from the home directory of the user to a specific location under the users home directory tree on a remote computer, note the tilde (~) means home directory of user.

scp ~/fswebcam/timelapse/dusk.avi user@12.34.56.78:/home/user/files/public/timelapse-video/dusk.avi

SFTP

To connect using sftp, a ftp tunnel using SSH, typically you can use the “Connect to Server” found for instance in Ubuntu under Places.

  • Set connection type to SSH
  • Set the server
  • IP address or FQDN
  • Port is set to 22, the standard SSH port
  • Folder is set to any folder that the user has permission to get into, /home/user is a safe bet.
  • Username is set
Connect to Server in Ubuntu, Place Menu
Connect to Server in Ubuntu, Place Menu

 

  • You can add a bookmark to keep getting in to this connection
  • It will ask for your login password upon connecting

SFTP via Browser

Also from a Firefox browser, Haven’t tried this on others! you can simply put sftp://user@serveraddress in the address bar. This will connect you to your home folder after you give the password at the prompt. I noticed that in Ubuntu, it will do the same thing that the “Connect to Server” option will do. It will show a folder on the desktop
after connecting with the browser that it the sftp connection

WinSCP

From Windows I have used the tool WinSCP for years as it supports FTP, SFTP and SCP. http://winscp.net/eng/index.php
It also loads support, by editing the registry perhaps for using the sftp:// type of connection via Windows Explorer.

rsync

For Linux there is also the command rsync, remotely synchronize directories. I haven’t used this but once or twice so I don’t have much to say about it yet.

One more comment on SSH. Typically I leave SSH (Port 22) closed and open it up only when needed on this server. I do this by remotely logging into a my router and opening it and closing it. Alternatively you could configure a firewall to only allow certain IP numbers a connection to SSH and denying all others. This can be done using the direct method of editing the iptables ( I will write more on this, TBD) or using a tool such as UFW or the graphical version of it called GUFW to  handle this.