FTP in Linux
FTP in Linux
FTP in Linux
FTP is built on a client-server architecture and uses separate control and data connections
between the client and the server.
FTP is user for Upload and Download files from Server to client and client to server
.
Here
Normal User : Upload and Download the files
To use the vsFTPd server, you must make sure that the vsFTPd software package is installed.
or
Enable the vsFTPd server by typing the following line (as root user):
# chkconfig vsftpd on
(or)
# /etc/init.d/vsftpd restart
Try to log in to the FTP server as anonymous (using any e-mail address as the password)
(if you are connecting over a network, use the more-secure sftp command instead):
$ ftp server1.example.com
Connected to yourhost
220 (vsFTPd 1.2.0)
530 Please login with USER and PASS
Name (localhost:chris): anonymous
331 Please specify the password.
Pasword: ******
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
:wq!
:wq!
#
[root@desktop6 vsftpd]# /etc/init.d/vsftpd restart
Shutting down vsftpd: [ OK ]
Starting vsftpd for vsftpd: [ OK ]
Note-
Selinux- (Security-Enhanced Linux)It is developed by NSA (National Security Agency).
Selinux is a extra layer of the firewall. and it has define different-2 mode.
EX;
Server side :
# useradd ajmal
#Password ajmal
Go to Client Side
#ftp 192.168.0.130
username : ajmal
Password : ajmal
error:
500 oops : cannot change director
login faild
Goto Server
#sestatus
[root@server ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: permissive
Policy version: 24
or
:wq
Enforce : --> meaning that the SELinux policy is in effect and things that it doesn't want to allow won't be
allowed.
# getsebool -a | grep ftp
# setbool -P ftp_home_dir on
# setsebool -P allow_ftpd_anon_write on
# setsebool -P allow_ftpd_full_access on
# /etc/init.d/vsftpd restart
#iptables -L
#iptables -F
#hostname
#ip a
#vim /etc/vsftpd/vsftpd.conf
----
anonymous_enables=no (change yes to no)
:wq
#chkconfig vsftpd on
go to client machine
:wq
#chkconfig vsftpd on
client side
#ftpd <server ip>
username :ajmal
passwd : ajmal
try
username : anonymous
passwd : anonymous
#vim /etc/vsftpd/ftpuser
ajmal
:wq
#chkconfig vsftpd on
go to client side
username: ajmal
passwd : ajmal
denid
ftp>
# vim /etc/vsftpd/vsftpd.conf
anon_upload_enable=YES
:wq!
ftp>!ls {List all file !ls for Remote machine, ls for local machine}
^c
# ls
now go to ftp
ftp>!ls
test.txt
ftp >
# passwd sami
Changing password for user sami.
New password:
BAD PASSWORD: it is too short
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@desktop6 ~]#
# vim /etc/vsftpd/vsftpd.conf
:wq!
#chkconfig vsftpd on
go to client machine