FTP (File Transfer Protocol)

FTP is a well-known and popular method for transferring files between computers using the internet. This method is built on a client-server model.

one of the oldest method of network data transfer, dating back to the early 1970s. As such, it is considered inadequate for modern needs, as well as begin intrinsically insecure. However, it is still in use and when security is not a concern (such as with so-called anonymous FTP) it can make sense. However, many websites, such kernel.org, have abandoned its use.

FTP Clients

passwords are user credentials that can be transmitted without encryption and are thus prone to interception. Thus, it was removed in favor of using rsync and web browser https access for example. An an alternative, sftp is a very secure mode of connection, which uses the Secure Shell (ssh) protocol, which we will discuss shortly. sftp encrpyts its data and thus sensitive information is transmitted more securely. However, it does not work with so-called anonymous FTP (guest user credentials).

SSH: Executing Commands Remotely

SSH is a cryptographic network protocol used for secure data communication.

you can also configure ssh to securely allow your remote access without typing a password each time.

to run a command on a remote system via SSH, at the command prompt, you can type ssh some_system my_command

Copying Files Securely with scp

scp user@remotesystem:/home/user/

you can also configure scp so that it does not prompt for a password for each transfer.

Lab 14.1 Solution

  1. first, make certain your network is properly configured. if your Ethernet device is up and running, ifconfig should display something like…

if it does not show a device with an IP address, you may need to start or restart the network and/or NetworkManager.

sudo systemctl restart NetworkManager
sudo systemctl restart network
sudo service NetworkManager restart
sudo service network restart

If your device was up but had no IP address, the above should have helped fix it, but you can try to get a fresh address with:

sudo dhclient eth0
  1. we should make sure you have a valid hostname assigned to your machine, with hostname:
hostname
  1. name need to be connected to a known IP address. This is usually done employing the DNS server (Domain Name System)

First, see if the site is up and reachable with ping

sudo ping -c 3 google.com

We have used sudo for ping; some recent Linux distributions have required this to avoid clueless or malicious users from flooding systems with such queries.

ping: unknown host google.com

it is likely that something is wrong with your DNS setup. Note on some systems, you will never see the unknown host message, but you will get suspicious result like:

sudo ping l89xl28vkjs.com

PING l..com.site (127.0.53.53) 56(84) bytes of data.
64 bytes from 127.0.53.53: icmp_seq=1 ttl=64 time=0.016 ms

where the 127.0.x.x address is a loop feeding back to the host machine you are on. you can eliminate this as being a valid address by doing:

whereas a correct result would look like:

host google.com

google.com ahs address ...

The above command utilizes the DNS server configured in /etc/resolv.conf on your machine. If you want to override that, you could do:

host google.com 8.8.8.8

you can also enter it in resolv.conf

  1. suppose host or dig fail to connect the name to an IP address. There are many reasons DNS can fail, some of which are:
  • the DNS server is down. In this case try pinging it to see if it is alive (you should have the IP address in /etc/resolv.conf)
  • The server can be up and running, but DNS may not be currently available on the machine.
  • Your route to the DNS server may not be correct.

How can we test the route? Tracing the route to one of the public name server we menthioned before

sudo traceroute 8.8.8.8

what if you only got the first line in the traceroute output? If this happens, most likely your default route is wrong. Try:

ip route show