linux ftp examples

– File Transfer Protocol (FTP) is a standard network protocol used to transfer files from one host to another host over a TCP-based network, such as the Internet.

– FTP is built on a client-server architecture.

– “/etc/vsftpd/vsftpd.conf” is default configuration file

– “/etc/vsftpd/ftpusers” contains list of users those are not allowed to login via ftp

– “/etc/vsftpd/user_list” listed users from this file can be allowed/denied the ftp access using “userlist_deny=NO/YES”

Generally used FTP Commands
———————————-

# get        # put

# ls        # dir

# pwd        # ! (Exit)

All FTP Commands
———————————
!                delete           literal          prompt          send
?                debug          ls                put                status
append      dir                mdelete      pwd               trace
ascii           disconnect    mdir           quit                type
bell            get               mget           quote             user
binary        glob             mkdir          recv               verbose
bye            hash            mls              remotehelp
cd              help            mput            rename
close          lcd              open            rmdir

Enabling “root” ftp access
——————————

To enable “root” user access to ftp do below things

– Uncomment “root” entry from “/etc/vsftpd/ftpusers”

– Make “userlist_enable=NO” from “/etc/vsftpd/vsftpd.conf”

Enabling other normal user ftp access
————————————–

To enable “root” user access to ftp do below things

– Uncomment “user” entry from “/etc/vsftpd/ftpusers”

– Make “userlist_enable=NO” from “/etc/vsftpd/vsftpd.conf”

– And add that user name into “/etc/vsftpd/user_list” file

Changing the default “/var/ftp/pub”
———————————-

# mkdir /home/pub

# mv /var/ftp/pub/* /home/pub/

# rm -rf /var/ftp/pub

# mount –bind /home/pub/ /var/ftp/pub/

Troubleshooting
——————————

Permission denied —– Check for user permission (anonymous is having permissions, check file permissions “/var/ftp/pub”)

Could not create file —– Check if you are not in “/var/ftp/pub” but somewhere else

————————————————————————————————————————————————–
We request and encourage you to leave a comment or share if you have more information / examples so as to keep this blog more informative, to benefit everyone of us.
————————————————————————————————————————————————–

Leave a Reply

Your email address will not be published. Required fields are marked *