How to install VSFTPD on opensuse15.1

How To install VSFTPD on opensuse15.1

Installation Procedure

Use the below command to install vsftpd

LinuxHelp:~ # zypper install vsftpd
Retrieving repository 'Main Update Repository' metadata ............................................................................................................................[done]
Building repository 'Main Update Repository' cache .................................................................................................................................[done]
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 2 NEW packages are going to be installed:
  system-user-ftp vsftpd

2 new packages to install.
Overall download size: 168.5 KiB. Already cached: 0 B. After the operation, additional 318.9 KiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package system-user-ftp-20170617-lp151.4.70.noarch                                                                                        (1/2),  10.2 KiB (   67   B unpacked)
Retrieving: system-user-ftp-20170617-lp151.4.70.noarch.rpm ............................................................................................................[done (13.7 KiB/s)]
Retrieving package vsftpd-3.0.3-lp151.6.3.x86_64                                                                                                     (2/2), 158.3 KiB (318.8 KiB unpacked)
Retrieving: vsftpd-3.0.3-lp151.6.3.x86_64.rpm ......................................................................................................................................[done]
Checking for file conflicts: .......................................................................................................................................................[done]
(1/2) Installing: system-user-ftp-20170617-lp151.4.70.noarch .......................................................................................................................[done]
Additional rpm output:
useradd -r -s /sbin/nologin -c "FTP Account" -U -d /srv/ftp ftp
groupadd -r ftp


(2/2) Installing: vsftpd-3.0.3-lp151.6.3.x86_64 ....................................................................................................................................[done]

To enable the vsftpd service

LinuxHelp:~ # systemctl enable vsftpd
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service.

Use the command to start the vsftpd service

LinuxHelp:~ # systemctl start vsftpd

Create ftp user using following command

LinuxHelp:~ # useradd  -d /srv/ftp u1
LinuxHelp:~ # useradd  –d  /srv/ftp u2

Update password to the user using following command

LinuxHelp:~ # passwd u1
New password: 
BAD PASSWORD: it is WAY too short
BAD PASSWORD: is too simple
Retype new password: 
passwd: password updated successfully

LinuxHelp:~# passwd u2
New password: 
BAD PASSWORD: it is WAY too short
BAD PASSWORD: is too simple
Retype new password: 
passwd: password updated successfully

Create group to add the ftp users in that group

LinuxHelp:~ # groupadd ftpuser 

Use this command to add the ftp user in the group

LinuxHelp:~ # gpasswd -a u1 ftpuser 
Add user u1 to group ftpuser

LinuxHelp:~ # gpasswd -a u2 ftpuser 
Add user u2 to group ftpuser

Navigate to the ftp default root directory location /srv/ftp as follows

LinuxHelp:~ # cd /srv/ftp/

Create one directory and file to test the ftp server

LinuxHelp:/srv/ftp # mkdir test

LinuxHelp:/srv/ftp # touch test1

Change group ownership of ftp directory then only ftp users can access the ftp server

LinuxHelp:/srv # chgrp -R ftpuser ftp/

The below command which is used to list all directory/file with permissions

LinuxHelp:/srv # ls -la
total 0
drwxr-xr-x 1 root   root     28 Aug  9 04:54 .
drwxr-xr-x 1 root   root    156 Aug  6 21:41 ..
drwxr-xr-x 1 root   ftpuser  18 Aug  9 05:00 ftp
drwxr-xr-x 1 tftp   tftp      0 Jan 31  2019 tftpboot
drwxr-xr-x 1 wwwrun root     26 Aug  9 04:05 www

Use vsftpd.conf file to configure the ftp server

LinuxHelp:/ftp # vim /etc/vsftpd.conf
write_enable=YES
ls_recurse_enable=YES
local_enable=YES
anonymous_enable=NO
ascii_upload_enable=YES
ascii_download_enable=YES
local_root=/ftp

After the completion of FTP Configuration, restart the vsftpd service then only configuration changes will update in the server

LinuxHelp:/ftp # systemctl restart vsftpd

Open browser, In address bar type ftp://ip address of your system

Give user credential in prompt window

Finally we configured vsftpd server in opensuse15.1

With this,Configuration Of VSFTPD Server In OpenSuse 15.1 Comes to end.

FAQ
Q
How to change the default vsftpd's root directory location?
A
To change the default VSFTPD's root directory location
Add the following line at the end of vsftpd.conf file without "#" symbol, local_root=example_directory
Q
What is vsftpd configuration file location?
A
The VSFTPD configuration file location is /etc/vsftpd.conf
Q
How to fix 500 OOPS: cannot change directory:/home/user2?
A
To fix 500 OOPS: cannot change directory:/home/user2 error follow the below procedure
create the user by the following command
" useradd -d /srv/ftp/ user2 "
In case if you have created the user already by using " useradd user2 "
you have to manually create the user2 directory under the home directory and change ownership " chown -R user2 user2 "
Q
What is the root directory location of vsftpd?
A
The root Directory Location of VSFTPD is /srv/ftp/
Q
What is the vsftpd?
A
'Very Secure File Transfer Protocol Deamon' (VSFTPD) is one of the most secure FTP daemons available, vsftpd is used as the default FTP server in the Ubuntu, CentOS, Fedora, NimbleX, Slackware and RHEL Linux distros.