search
HomeOperation and MaintenanceLinux Operation and MaintenanceHow to check whether vsftpd is installed in Linux

Linux method to check whether vsftpd is installed: 1. Execute the "rpm -qa | grep vsftpd" command. If the relevant information about vsftpd is output, it means it has been installed, otherwise it is not installed; 2. Execute "vsftpd -v" command, if the version information of vsftpd is output, it means installation.

How to check whether vsftpd is installed in Linux

#The operating environment of this tutorial: CentOS 6 system, Dell G3 computer.

Check whether vsftpd is installed

Method 1: Use the rpm -qa | grep vsftpd command to Detection

If there is output related information about vsftpd, it means vsftpd has been installed, otherwise it means it has not been installed

How to check whether vsftpd is installed in Linux

Method 2: Use the vsftpd -v command to detect the installation version by viewing it

If the version information of vsftpd is output, it means it is installed, otherwise it means it is not installed

How to check whether vsftpd is installed in Linux

If vsftpd is not installed, you can use yum to install it

Since the vsftpd software depends on some other software and software libraries, it is installed using yum. Relatively easy

1. Configure the yum source

Network: When connected to the Internet, no other configuration is required

Cannot be connected to the Internet: You can configure the local yum source, The Centos system disk can be configured as u pan yum source

2. Install vsftpd

For installing software using yum method, you usually need to use Only root users can install. Installation command: yum -y install vsftpd

[root@localhost ~]# yum -y install vsftpd
Loaded plugins: fastestmirror, security
Setting up Install Process
Determining fastest mirrors
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: mirror.bit.edu.cn
base | 3.7 kB 00:00
base/primary_db | 4.7 MB 00:01
extras | 3.4 kB 00:00
extras/primary_db | 29 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 1.4 MB 00:00
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:2.2.2-24.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================
Installing:
vsftpd x86_64 2.2.2-24.el6 base 156 k

Transaction Summary
=============================================================================================================================
Install 1 Package(s)

Total download size: 156 k
Installed size: 340 k
Downloading Packages:
vsftpd-2.2.2-24.el6.x86_64.rpm | 156 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : vsftpd-2.2.2-24.el6.x86_64 1/1
Verifying : vsftpd-2.2.2-24.el6.x86_64 1/1

Installed:
vsftpd.x86_64 0:2.2.2-24.el6

Complete!

The installation is successful. You can use the sftpd -v command to check the version

3. Default configuration

3.1 Configuration file location

The vsftpd service configuration file is in the /etc/vsftp directory by default, and the core configuration file is vsftpd.conf.

[root@localhost ~]# ll /etc/vsftpd/
total 28
-rw-------. 1 root root 125 May 11 2016 ftpusers
-rw-------. 1 root root 361 May 11 2016 user_list
-rw-------. 1 root root 4599 May 11 2016 vsftpd.conf
-rwxr--r--. 1 root root 338 May 11 2016 vsftpd_conf_migrate.sh
-rw-------. 1 root root 4647 Jun 20 20:07 vsftpd.conf.rpmsave
[root@localhost ~]#

3.2 Default root directory

The default root directory of vsftp service is /var/ftp. The owner and group of this directory are both root.

[root@localhost ~]# ll -d /var/ftp/
drwxr-xr-x. 3 root root 4096 Jul 1 16:58 /var/ftp/
[root@localhost ~]# ll /var/ftp/
total 4
drwxr-xr-x. 2 root root 4096 May 11 2016 pub
[root@localhost ~]#

3.3 Default anonymous user

During the installation process of vsftpd, an ftp user will be created as a proxy user for anonymous users. The ftp user cannot log in to the system.

[root@localhost ~]# id ftp
uid=14(ftp) gid=50(ftp) groups=50(ftp)
[root@localhost ~]# cat /etc/passwd | grep ftp
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
[root@localhost ~]#

3.4 Default permissions

Under the default configuration, the vsftpd service is allowed Anonymous user access, using the Linux system user as the user source, allowing system users to log in.

  • Anonymous user permissions: root directory /var/ftp, readable, downloadable, unable to upload files, No new folders can be created, no files can be deleted/renamed

  • System user permissions: The root directory is the user's home directory, you can jump out of the user's home directory, and the permissions on files are controlled by linux user permissions.

System configuration

After installing vsftpd, you need to make some modifications to the system

  • ftp_home_dir: Solve non-root user login error: OOPS: child died

  • ##allow_ftpd_full_access: Solve the problem of unable to upload files

  • selinux: To solve the problem of not being able to log in to OOPS: priv_sock_get_cmd

  • [root@localhost vsftpd] setsebool -P ftp_home_dir on
    [root@localhost vsftpd] setsebool allow_ftpd_full_access on
    [root@localhost vsftpd]# vim /etc/selinux/config
    
    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    # enforcing - SELinux security policy is enforced.
    # permissive - SELinux prints warnings instead of enforcing.
    # disabled - No SELinux policy is loaded.
    SELINUX=permissive
    # SELINUXTYPE= can take one of these two values:
    # targeted - Targeted processes are protected,
    # mls - Multi Level Security protection.
    SELINUXTYPE=targeted

Server startup

Centos series can start the server through the service command. Stop, restart

1. Start the server

[root@localhost ~]# service vsftpd start
Starting vsftpd for vsftpd: [ OK ]
[root@localhost ~]#

2. Restart the server

[root@localhost ~]# service vsftpd restart
Shutting down vsftpd: [ OK ]
Starting vsftpd for vsftpd: [ OK ]
[root@localhost ~]#

3. Stop the server

[root@localhost ~]# service vsftpd stop
Shutting down vsftpd: [ OK ]
[root@localhost ~]#

4. Set auto-start at boot

You can choose to set the vsftpd service to auto-start at boot. You can use the chkconfig command or customize it. Startup script. I use the chkconfig command. chkconfig can set the boot startup for each run level of Linux.

    0: means shutdown
  • 1: single-user mode
  • 2: Multi-user command line mode without network connection
  • 3: Multi-user command line mode with network connection
  • 4: Not available
  • 5: With graphical interface Multi-user mode
  • 6: Restart
4.1 View vsftpd service startup status

[root@localhost ~]# chkconfig | grep vsftpd
vsftpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@localhost ~]#

4.2 Modify vsftpd startup

    We only set the boot level to 35 to automatically start the vsftpd service.
  • [root@localhost ~]# chkconfig --level 35 vsftpd on
    [root@localhost ~]# chkconfig | grep vsftpd
    vsftpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
    [root@localhost ~]#

vsftpd firewall settings

    vsftpd service listens to ports 20 and 21 by default. If other computers want to access, they need to release the firewall port or close the firewall. Turning off the firewall is not recommended.
  • vsftpd uses the PASV security mode by default to transmit data, so it needs to be set PASV port upper and lower limits, and release the port

1. Set the PASV port upper and lower limits

Edit the configuration file: /etc/vsftpd/vsftpd.conf, Append two lines at the end of the file:

#设定PASV 端口下限
pasv_min_port=61000
#设定PASV 端口上限
pasv_max_port=62000

2. Release the firewall port

Edit the configuration file: /etc/sysconfig/iptables, add the following configuration to the file:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
-A OUTPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A OUTPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 61000:62000 -j ACCEPT
-A OUTPUT -m state --state NEW -m tcp -p tcp --dport 61000:62000 -j ACCEPT

3. Restart the service

Restart the vsftpd service and firewall

[root@localhost ~]# service vsftpd restart
Shutting down vsftpd: [ OK ]
Starting vsftpd for vsftpd: [ OK ]
[root@localhost ~]# service iptables restart
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: [ OK ]
[root@localhost ~]#

相关推荐:《Linux视频教程

The above is the detailed content of How to check whether vsftpd is installed in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
The 5 Core Components of the Linux Operating SystemThe 5 Core Components of the Linux Operating SystemMay 08, 2025 am 12:08 AM

The five core components of the Linux operating system are: 1. Kernel, 2. System libraries, 3. System tools, 4. System services, 5. File system. These components work together to ensure the stable and efficient operation of the system, and together form a powerful and flexible operating system.

The 5 Essential Elements of Linux: ExplainedThe 5 Essential Elements of Linux: ExplainedMay 07, 2025 am 12:14 AM

The five core elements of Linux are: 1. Kernel, 2. Command line interface, 3. File system, 4. Package management, 5. Community and open source. Together, these elements define the nature and functionality of Linux.

Linux Operations: Security and User ManagementLinux Operations: Security and User ManagementMay 06, 2025 am 12:04 AM

Linux user management and security can be achieved through the following steps: 1. Create users and groups, using commands such as sudouseradd-m-gdevelopers-s/bin/bashjohn. 2. Bulkly create users and set password policies, using the for loop and chpasswd commands. 3. Check and fix common errors, home directory and shell settings. 4. Implement best practices such as strong cryptographic policies, regular audits and the principle of minimum authority. 5. Optimize performance, use sudo and adjust PAM module configuration. Through these methods, users can be effectively managed and system security can be improved.

Linux Operations: File System, Processes, and MoreLinux Operations: File System, Processes, and MoreMay 05, 2025 am 12:16 AM

The core operations of Linux file system and process management include file system management and process control. 1) File system operations include creating, deleting, copying and moving files or directories, using commands such as mkdir, rmdir, cp and mv. 2) Process management involves starting, monitoring and killing processes, using commands such as ./my_script.sh&, top and kill.

Linux Operations: Shell Scripting and AutomationLinux Operations: Shell Scripting and AutomationMay 04, 2025 am 12:15 AM

Shell scripts are powerful tools for automated execution of commands in Linux systems. 1) The shell script executes commands line by line through the interpreter to process variable substitution and conditional judgment. 2) The basic usage includes backup operations, such as using the tar command to back up the directory. 3) Advanced usage involves the use of functions and case statements to manage services. 4) Debugging skills include using set-x to enable debugging mode and set-e to exit when the command fails. 5) Performance optimization is recommended to avoid subshells, use arrays and optimization loops.

Linux Operations: Understanding the Core FunctionalityLinux Operations: Understanding the Core FunctionalityMay 03, 2025 am 12:09 AM

Linux is a Unix-based multi-user, multi-tasking operating system that emphasizes simplicity, modularity and openness. Its core functions include: file system: organized in a tree structure, supports multiple file systems such as ext4, XFS, Btrfs, and use df-T to view file system types. Process management: View the process through the ps command, manage the process using PID, involving priority settings and signal processing. Network configuration: Flexible setting of IP addresses and managing network services, and use sudoipaddradd to configure IP. These features are applied in real-life operations through basic commands and advanced script automation, improving efficiency and reducing errors.

Linux: Entering and Exiting Maintenance ModeLinux: Entering and Exiting Maintenance ModeMay 02, 2025 am 12:01 AM

The methods to enter Linux maintenance mode include: 1. Edit the GRUB configuration file, add "single" or "1" parameters and update the GRUB configuration; 2. Edit the startup parameters in the GRUB menu, add "single" or "1". Exit maintenance mode only requires restarting the system. With these steps, you can quickly enter maintenance mode when needed and exit safely, ensuring system stability and security.

Understanding Linux: The Core Components DefinedUnderstanding Linux: The Core Components DefinedMay 01, 2025 am 12:19 AM

The core components of Linux include kernel, shell, file system, process management and memory management. 1) Kernel management system resources, 2) shell provides user interaction interface, 3) file system supports multiple formats, 4) Process management is implemented through system calls such as fork, and 5) memory management uses virtual memory technology.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.