User Tools

Site Tools


documentation:setup_and_user_guide:basic_client_configuration

NAS4Free - Basic FTP Client Configuration

Installed Version - NAS4Free-x64-LiveCD-9.0.0.1.43.ISO

Introduction

While CIFS and NFS are file system protocols, which means that whole file systems can be shared on the network, and other computers can use those file systems as if they were attached locally, FTP (File Transfer Protocol) is a TCP protocol for uploading and downloading files between computers. FTP works on a client/server model. The server component is called an FTP daemon. It continuously listens for FTP requests from remote clients. When a request is received, it manages the login and sets up the connection. For the duration of the session it executes any of commands sent by the FTP client.

Access to an FTP server can be managed in one of two ways:

  1. Anonymous.
  2. Authenticated.

In the Anonymous mode, remote clients can access the FTP server by using the default user account called “anonymous” or “ftp” and sending an email address as the password.

In the Authenticated mode a user must have an account and a password. User access to the FTP server directories and files is dependent on the permissions defined for the account used at login. As a general rule, the FTP daemon will hide the root directory of the FTP server, and provide access only to the FTP Home directory. This hides the rest of the file system from remote sessions.

Warning - Enabling anonymous FTP upload can be an extreme security risk. It is best to not enable anonymous upload on servers accessed directly from the Internet.

Traditional FTP is rather insecure. When you login, your username and password are transmitted in clear text, raising the possibility of your credentials being 'sniffed' by a malicious person. Fortunately there's an easy answer to this. You can quite easily configure your FTP server to use OpenSSL encryption, so that username & password, and even data files, are encrypted during transfer. For details see:

Prerequisites

Before deploying FTP on NAS4Free you should be familiar with:

  • Linux file and directory permissions.
  • Mounting and detaching (unmounting) filesystems.
  • Changing File Permissions and File Ownership.

Open a Terminal (Console, CLI) on your client PC and make sure you understand these commands:

  • man mount
  • man umount
  • man chown
  • man chmod
  • man ftp

You can also look them up on FreeBSD.org's Man Pages.

Install NAS4Free, if you already haven't.

See SUG Section 2.3-Installing NAS4Free on disk.

Or you may run it from the CDROM as required for testing.

See SUG Section 2.2-Using NAS4Free with the CDROM and a removable disk (LiveCD mode).

Basic FTP COMMANDS

The following are basic commands you can use with a CLI to manage your FTP session. These commands should work on Windows and Linux clients.

  • delete – Deletes the file in the remote directory.
  • lcd – Changes directory on your local machine.
  • mkdir – Makes a new directory within the current remote directory.
  • mget – Copies multiple files from the remote machine to the local machine. You will be prompted for a Y/N answer before transferring each file, unless you use the “Prompt Off” command before hand.
  • mput – Copies multiple files from the local machineto the remote machine. You will be prompted for a Y/N answer before transferring each file, unless you use the “Prompt Off” command before hand.
  • put – Copies a file from the local machine to the remote machine.
  • pwd – Displays the current working directory on the remote machine.
  • rmdir – Deletes a directory in the current remote machine.
  • quit – Exits ftp.

Server Configuration

For details about the FTP service please see SUG Section 6.2-FTP-File Transfer Protocol.


1 - Enable FTP, and select the parameters/options you want to use for access.


2 - Then click the “Save and Restart” Button.

Verify Connection to Server

Connect your Client to the Network, and use PING to verify that you can reach the Server's IP Address. You can also try to open the NAS4Free WebGUI, if you are successful then you have a working connection.

Client Software

Linux and Windows both have built-in, CLI based, FTP clients. Most people will probably prefer a GUI based client. A popular client is Filezilla, and Filezilla supports a version for most Operating Systems. There are many others and you can use Google to find one that's right for you.

Testing your FTP service and connection.

The FTP service should now be running, so let's test the FTP Connection manually, with the CLI, before trying to use Filezilla. If you can't login, it's likely that there is no account created for you.

1 - Open a Terminal Window (Console, CLI).

2 - Type the following:

ftp 192.168.1.250

3 - Logon to FTP: If Anonymous Users was selected, your username will be anonymous, otherwise for local users, enter your username and press the “ENTER” key. Enter your Password and press the “ENTER” key. You should see something like this:

Connected to 192.168.1.250
220 ProFTPD 1.3.2e Server (ldknas4free FTP Server) [::ffff:192.168.1.250]
Name (192.168.1.250:larry): ldk
331 Password required for ldk
Password:
230-Welcome to NAS4Free FTP Server
230 User ldk logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

4 - Type the following:

ls

5 - You should see the following:

ftp> ls200 PORT command successful
150 Opening ASCII mode data connection for file list
drwxrwxrwx 3 root wheel 512 Jul 18 12:24 CF_Data_Part2
drwxrwxrwx 8 root wheel 7680 Jul 25 12:51 mysata
drwxr-xr-x 4 root wheel 512 Jul 21 13:45 ramdisk1
drwxr-xr-x 3 root wheel 512 Jul 21 13:45 ramdisk2
226 Transfer complete
ftp>

6 - Exit FTP:

ftp>quit

This procedure just verified that you can connect manually using ftp. You will use the Menu's from Filezilla to transfer files.

REF: Basic FTP Commands

Configuring FTP Access Behind a Firewall

If you want to use NAS4Free behind a NAT box (router or firewall) that does not support FTP you should:

  1. Configure your NAT box (router or firewall) to forward port (TCP 21 and a RANGE of TCP ports) to your NAS4Free
  2. Add your public IP address on the ‘Passive IP address’ field
  3. Add your lower TCP port of your configured range on the ‘pasv_min_port’ field
  4. Add your high TCP port of your configured range on the ‘pasv_max_port’ field
  5. Enable ‘NAT Mode’

You will be opening several ports, these are generic instructions and it may be wise for you to consult the manufacturers' manual for information specific to your equipment and application. Port 21 may be blocked by some ISP's and therefore you may need to use another unassigned port, which probably would be a wise decision. For best results don't use known port numbers at all, use unassigned, private ports per IANA recommendations. If you have trouble configuring your router or getting it to work, look for help on the manufacturers' website or Google.

documentation/setup_and_user_guide/basic_client_configuration.txt · Last modified: 2018/07/08 16:57 (external edit)