Saturday, November 21, 2015

Command lines for for FTP

Hello,

In this post we will talk about using FTP services from a command line.

So to connect to an FTP server, you have to log on first by typing "ftp sitename" or "ftp ipaddress"
where "ipaddress" is the ip address of the FTP server, or sitename is the Fully qualified domain name of the ftp server.

Once you type this command, you will prompted for a username then a password. The username and the password are the ones created for you on the FTP server.

Here are screenshots

The most used commands:
"get filename1" this will transfer the file named "filename" from the FTP server to your PC. you have to type the filename completely (including the extension .jpg, .txt...)
"put filename2" this will transfer the filename2 located in your PC to the FTP server. Same as get command, the name of the file must be written completely.

What if we need to transfer more than one file ? We have "mget" and "mput"
If we type "mput *" it will start copying files from our local directory to the FTP server. But before copying each file we will be prompted.
If we type "mget *", files will be copied from the FTP server (the directory that we are in) to our local directory, and we will be prompted to confirm for each file.

If we don't want to be prompted for each file; so before using the "mput" or the "mget", we type "prompt" this will turn the interactive transfer off .

The transfer types:  There is different transfer types. The most known transfer types are ASCII and binary.
Text Files from different platforms (Windows, Unix..) have different kinds of line ending.
FTP ASCII transfer type sometimes do translations for lines ending.
Binary transfers the file same as it is
If you are doing a migration for a specific software or database from a windows to a Linux and vice-versa, and in the migration you have to export/import data, and if you are using FTP to transfer these data, you better change the mode binary.
It happened to me once I was migrating from CiscoWorks on Windows to a CiscoPrime LMS appliance based on Linux. When trying to import the data exported from the windows, the Linux based appliance was seeing the data corrupted. After I changed the mode to binary, the import worked successfully into the Cisco LMS appliance.

I will add some screenshots to explain more about these commands, we will also talk about other commands in FTP.

I hope this was helpful, and I would like to thank you for reading



 

Sunday, November 1, 2015

How to configure Filezilla FTP server

Hello,

In the previous article, we have installed Filezilla FTP server. In the current post, we will explain how to configure Filezilla FTP server for basic functionality.

For Filezilla FTP server to work, all what you need to do is to only add a user, and assign the appropriate permissions on the specific directories.

First open, the filezilla FTP Server Admin interface:
To add a user, we click on the "Edit" Menu, then click on "Users"
Then the users Tab will open. As we can see our users list is empty


In order to add a new user, we have to click on the button "Add". So we get a new window "Add user account". We type the username that we want, we have used "testuser" as username in this example. Notice that currently we don't have any group. So the user will not be member of any group. 
After we entered the username we want, we click on ok, and the user will be created and enabled as you can see in the screenshot below
The next step is to set the password for this user, so we click on the checkbox near "Password" and we enter the Password for this user.  In this example, we entered "Password123"
Then, we have to assign this user specific directory, and configure the appropriate permissions for him. So in the list on the left, we click on "Shared folders". Then we add a specific directory by clicking on the "Add" button. 


After we click on the "Add" , we have to select the folder we want. The folder has to be created before on our PC (example we created a directory called "FTPStorage" in "C:\_Labs"
After we select the folder that we want we click on OK, the folder will appear in the "Directories" List. The Last step that we have is to assign the user the appropriate permissions. In this example, we will allow the user to read/write files and to list directories and sub directories. We will not allow the user to create directories, or to delete them, neither to delete files or to Append to files.
After we are done with the permissions, we click on OK.



Note: You can create more than one directory for a user. But only one directory will be his default directory. The default directory is the directory the user reach it immediately after logging-in to the FTP. To set the home directory, you can use the button "Set as home dir". The directory is the one
If you have one directory only then it will be the default directory. (as our case now). 
In case you have more than one directory, the default directory is the one that has the letter "H" in Bold in the begining. Look at the screenshot below. The default directory is the second one in the list because it has the letter H

Now as we have created a username for our FTP server, we will test the access. You can use windows explorer, or command line, or also you can use an FTP client, such as Filezilla FTP client.
We will first use windows explorer. 

To use your FTP server, you must know where to connect, so you need the "Fully qualified domain name" or the "IP address" of your server. To get the IP address in windows, type "ipconfig" in the command prompt. Here the screenshot below

As we see, our "IP address" is 169.254.42.64". We open "My Computer", and we we type  on top "ftp://168.254.42.64", then we press enter. we will prompted to enter a username and password for our FTP server

So we enter the username we have created "testuser" and the password "Password123", then we press Logon
After we press on "Log On", we will be in the home directory of the testuser.


As for a test, we did two things:
First we have tried to create a new directory in the FTP window, we got an error that we don't have enough permissions

second we have tried to copy a file somewhere in our PC to the FTP window, the copy was successfull

To confirm more our success and error, we can look at the logs in the Admin interface of Filezilla.
We can see in the begining, that the user was able to login successfully. But when he tried to create a directory, he was not allowed, because of permission denied. We can also at the end, that the user was able to successfully transfter a file to the FTP server.

To logout from the FTP with windows explorer, all what we have to do is to close the window

To login from the command line,
  • we have to type "ftp 169.254.42.64"
  • we will be prompted for username and password,
  • after properly entering the username and password, our login will succeed.
  • We will explain in future articles about commands in FTP command line interface.
  • To logout from the FTP, we need to type "bye" and press enter



You can follow our networking blog http://nssamtl.blogspot.com

I hope this was helpful and I would like to thank you for reading



Install an FTP Server. FileZilla

Hello,

There is  many FTP server that you can find for free. You can install FTP server as a role in microsoft windows.

In this article, we will show the installation steps for Filezilla Server. It is very easy

The first thing, you need to download Filezilla FTP Server, go to this link
https://filezilla-project.org/download.php?type=server

And click on the download button.
You get an executable file
So we double click, if we are on windows 7 or later, we will prompted for the autorisation to execute the software, so we click on yes.
Then we find the licensing agreement, we read the licensing agreement and then we click on "I agree".
The second step, we will prompted to choose the components that we need to install. By default 4 are selected. Only the source code is not selected. For normal FTP usage, we don't need the source code. So we keep the default selections. The most important components are the FileZilla server and the Admin interface
Then we will be prompted to choose the installation location. I usually keep the location by default. If you would like to choose a new location. Don't worry about the data files, because you can specify (in the configuration) where is the FTP storage is located.
Then you need to set some parameters. The Admin port. I usually leave the Admin port as default (14147). Also make sure that the option "Install as service, started with windows(default)" is the one selected. Because If filezilla is installed as service, it will be independant from users and users action. The FileZilla FTP server will start when windows startup.

Then choose how the admin interface will startup. The default is to start whenever user logs on. And it applies to all users. If you don't want to see the Admin interface pop-up each time you log in to windows, so you better choose to not start the Admin interface when user log on.  The option if kept "Start Interface after setup completes" will show you an idea of what will be started each time a user logon. I kept the default.
Here is is the Admin Interface
The server address is the localhost (which is the PC we are working on) , and we have a port number. So If I click on OK, I will get to the admin interface.


Note: The Admin interface can be installed on a separate PC. So let's say the FTP Filezilla server has been installed (with default port-number 14147) on PC-A with IP address 192.168.1.1, and the Admin interface is installed on PC-B with IP address 192.168.1.2. If I open the Admin interface on PC-B, in the server Adress, I type "192.168.1.1" and the port 14147, i will be able to  manage the FileZilla Server on PC-A. That's why it is important to protect FileZilla Administration with an Administration Password.

In the next Article, we will explain about the configuration of a Filezilla FTP server.

You can follow our networking blog http://nssamtl.blogspot.com

I hope this was helpful, and I would like to thank you for reading


FTP File transfer protcol ,Overview

Hello,
FTP (File transfer protocol) is an application layer protocol used to transfer files. FTP can be used to transfer files in the order of GB.
FTP is a client-server application, there is an FTP server and an FTP client.

FTP is a tcp application. Then FTP is reliable.

The FTP application (on the server side) listens to the TCP-port 21. There might be other port that can be used by FTP, we will more about all FTP ports in future articles.

The FTP starts by a TCP connection, made by the client to the FTP Server. After the 3 way TCP handshake is successful, the FTP connection is established and the FTP server will challenge the FTP client for authentication in case there is need.

In case of authentication, the client should enter username/password that exists on the FTP server and has the authorisation(permissions) to access FTP directories. In case it has, there will be successful log in, and in case it doesn't have there will be login failed.

After a successful login, the user will be able to transfer files from and to the server, depending on the authorizations he has.

We will explain more details about the commands. But to start we have to install an FTP server, so it will be in the next article

You can follow our networking blog http://nssamtl.blogspot.com

I would like to thank you for reading