FTP(File Transfer Protocol):
-> FTP is a client-server protocol.
-> FTP requires the client to enter plaintext password to access the server.
-> FTP uses SSH protocol for password verification and user authentication.
-> One system acts as client and other acts as server.
-> The server can regulate the access of its contents to several users.
-> FTP operates in two modes.
*Active
*Passive
-> In Active mode, two ports are used.
Ex. If client connects to a port N, it can listen to the server response from port(N+1)
-> In Passive mode, only one port is used.
Default Location of FTP directory in Server Computer:
/srv/ftp
Default Location of FTP configuration settings:
/etc
and the file name is vsftpd.conf
STEP 1:
In the vsftpd.conf file,(figure :1)
-> FTP is a client-server protocol.
-> FTP requires the client to enter plaintext password to access the server.
-> FTP uses SSH protocol for password verification and user authentication.
-> One system acts as client and other acts as server.
-> The server can regulate the access of its contents to several users.
-> FTP operates in two modes.
*Active
*Passive
-> In Active mode, two ports are used.
Ex. If client connects to a port N, it can listen to the server response from port(N+1)
-> In Passive mode, only one port is used.
Default Location of FTP directory in Server Computer:
/srv/ftp
Default Location of FTP configuration settings:
/etc
and the file name is vsftpd.conf
STEP 1:
In the vsftpd.conf file,(figure :1)
figure :1
--> Enable Write-Enable (write_enable=yes)
--> To allow local users, Enable local users(local_users=yes)
figure :2
STEP 2:
Restart the FTP process by using the following Command
sudo service vsftpd restart
STEP 3: Enter into FTP by typing the following Command(figure:3)
ftp<hostname> or ftp<IP-Address of the server>
figure :3
Enter user name and password.(figure :4)
(figure :4)
After correct Authentication, use GET and PUT commands to move files from server to client and vice-versa.
GET: Server--->Client
PUT: Server<---Client
GET:(figure :5)
$get
(local-file)<path to the local file>
(remote-file)<path to the remote file>
(figure :5)
$put
(local-file)<path to the local file>
(remote-file)<path to the remote file>
(figure :6)
Additional Information:
-> The server system can restrict the access of the client users within the
root directories using chroot enable option within vsftpd.conf file.
Excellent. i'm sure this will be useful to many. Do show how to achieve the same using ssh as well in another post! :D
ReplyDeletegreat article. I found one inaccuracy which I'll point out for other readers. Point 3 -- "FTP uses SSH protocol" is incorrect. Read this >> https://www.yireo.com/blog/1452-why-ssh-instead-of-ftp
ReplyDeleteSSH is totally different. If I wanted to securely upload data to a web server you could use scp or sftp. I personally use
rsync --partial --progress --rsh=ssh username@domain.com: because for large files if the transfer fails I can continue it from where the network broke without having to re-upload the entire file again!