linux ftp serverLinux serverNETWORK ADMINISTRATIONS

(B17) Linux Admin part13 FTP – get, put

20220507 114508
ftp – file transfor protocol
portno -20,21

ftp
sftp
vsftp – very secure FTP

ftp client — filezilla, cuteftp,,..

1. Package ftp , vsftpd
yum clean all
yum repolist

yum info vsftpd
yum install vsftpd

2. service

systemctl status vsftpd
● vsftpd.service – Vsftpd ftp daemon
Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)
Active: inactive (dead)

systemctl start vsftpd

systemctl enable vsftpd

systemctl status vsftpd
● vsftpd.service – Vsftpd ftp daemon
Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2022-05-07 11:52:06 IST; 17s ago
Main PID: 17396 (vsftpd)
CGroup: /system.slice/vsftpd.service
└─17396 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
———————————-
3. default location of ftp/vsftpd — /var/ftp/pub
ls /var/ftp/pub/
cd /var/ftp/pub/
ls

cat ftp1.txt
this is ftp 1 file
it is text file

ls
ftp1.txt

ls -Z ftp1.txt
-rw-r–r–. root root unconfined_u:object_r:public_content_t:s0 ftp1.txt

systemctl restart vsftpd
—-
verify

linux VM:

4. firewall

[root]# firewall-cmd –list-all
public (active)

services: dhcpv6-client ssh
ports: 80/tcp
protocols:

[root]# firewall-cmd –zone=public –permanent –add-port=21/tcp
success
[root]# firewall-cmd –zone=public –permanent –add-port=20/tcp
success

[root]# firewall-cmd –zone=public –permanent –add-service=ftp
success
[root]# firewall-cmd –reload
success
[root]# firewall-cmd –list-all
public (active)

services: dhcpv6-client ftp ssh
ports: 80/tcp 21/tcp 20/tcp
protocols:

————————-
yum install ftp*

open putty : login :student17a

————————

win:
filezilla
or
winscp

connect :student17a, portno21
——-
cmd:
C:UsersAinesh

ftp 172.16.0.100

username: student17a
password student17a

ls

get emp1 — get -download file

put ticket1.xml — put -upload file

help

bye

————–
get – file download
put – file upload
mget – mutliple file download
mput -multiple file upload

———–
C:UsersAinesh : e:

E: cd “Batch 17 2022”

E:Batch 17 2022 : ftp 172.16.0.100
Connected to 172.16.0.100.
220 (vsFTPd 3.0.2)
200 Always in UTF8 mode.
User (172.16.0.100:(none)): student17a
331 Please specify the password.
Password:
230 Login successful.
ftp
ftp ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
02-05 linux.txt
Desktop
Documents
Downloads
Music
Pictures
Public
Screenshot from 2022-04-28 15-36-31.png
Templates
Videos
cf1
data1
data2
data4
data5
df1
df2
ef1
emp1
emp2
eof1
file22
gfile1
hfile1
of1
sfile1
ticket1.xml
226 Directory send OK.
ftp: 252 bytes received in 0.05Seconds 4.85Kbytes/sec.

ftp get gfile1
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for gfile1 (186 bytes).
226 Transfer complete.
ftp: 186 bytes received in 0.00Seconds 186000.00Kbytes/sec.

ftp put disk1.png
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 Transfer complete.
ftp: 35048 bytes sent in 0.00Seconds 35048.00Kbytes/sec.

ftp put 29-04linux.txt
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 Transfer complete.
ftp: 17244 bytes sent in 0.00Seconds 17244.00Kbytes/sec.

ftp bye
221 Goodbye.

E:Batch 17 2022

————————

source

by Latif Shaik

linux ftp command