In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "linux how to check whether vsftpd is installed", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "linux how to check whether vsftpd is installed" bar!
Linux checks whether vsftpd is installed: 1, execute the "rpm-qa | grep vsftpd" command, if you output the relevant information about vsftpd, it means that it has been installed, otherwise it is not installed; 2, execute the "vsftpd-v" command, if you output the version information of vsftpd, it means installation.
The operating environment of this tutorial: CentOS 6 system, Dell G3 computer.
Detect if vsftpd is installed
Method 1: use the rpm-qa | grep vsftpd command to detect
If there is information about the output vsftpd, it means that vsftpd has been installed, otherwise it is not installed.
Method 2: use the vsftpd-v command to detect by viewing the installation version
If you output the version information of vsftpd, it is installed, otherwise it is not installed.
If you do not have vsftpd installed, you can use yum to install
Because vsftpd software depends on some other software and software libraries, it is easy to install it by yum.
1. Configure the yum source
Networking: in the case of networking, no other configuration is required
No networking: local yum source can be configured, Centos system disk can be configured as u pan yum source
2. Install vsftpd
For installing software using yum, you usually need to use a root user to install it. Installation command: yum-y install vsftpd
[root@localhost ~] # yum-y install vsftpdLoaded plugins: fastestmirror SecuritySetting up Install ProcessDetermining fastest mirrors* base: centos.ustc.edu.cn* extras: centos.ustc.edu.cn* updates: mirror.bit.edu.cnbase | 3.7kB 00:00base/primary_db | 4.7MB 00:01extras | 3.4kB 00:00extras/primary_db | 29 kB 00:00updates | 3.4kB 00:00updates/primary_db | 1.4MB 00:00Resolving Dependencies-- > Running transaction check--- > Package vsftpd.x86_64 0vir 2.2.2-24 .el6 will be installed-- > Finished Dependency ResolutionDependencies Resolved=Package Arch Version Repository Size=Installing:vsftpd x86 24.el6.x86_64 1/1Verifying 64 2.2.2-24.el6 base 156 kTransaction Summary=Install 1 Package (s) Total download size: 156 kInstalled size: 340 kDownloading Packages:vsftpd-2.2.2-24.el6.x86_64.rpm | 156 kB 00:00Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning TransactionInstalling: vsftpd-2.2.2-24.el6.x86_64 1/1Verifying: vsftpd-2.2.2-24.el6.x86_64 1 / 1Installed:vsftpd.x86_64 0Plus 2.2.2-24.el6Complete!
If the installation is successful, you can use the sftpd-v command to check the version
3. Default configuration
3.1 profile 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 RWMI. 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 the vsftp service is / var/ftp, which belongs to and belongs to 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 4drwxr-xr-x. 2 root root 4096 May 11 2016 pub [root@localhost ~] #
3.3 default anonymous user
During vsftpd installation, ftp users are created as proxy users for anonymous users, and ftp users cannot log in to the system.
[root@localhost ~] # id ftpuid=14 (ftp) gid=50 (ftp) groups=50 (ftp) [root@localhost ~] # cat / etc/passwd | grep ftpftp:x:14:50:FTP User:/var/ftp:/sbin/nologin [root@localhost ~] #
3.4 default permissions
By default, the vsftpd service allows anonymous users to access, uses Linux system users as user sources, and allows system users to log in.
Anonymous user permissions: root directory / var/ftp, readable, downloadable, cannot upload files, cannot create new folders, and cannot delete / rename files
System user rights: the root directory is the user's home directory, which can jump out of the user's home directory, and the permissions on files are controlled by linux user rights.
System configuration
After installing vsftpd, you need to make some changes to the configuration of the system
Ftp_home_dir: solve non-root user login error report: OOPS: child died
Allow_ftpd_full_access: resolve the problem that files cannot be uploaded
Selinux: solve the problem of not logging 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, stop and restart the server through the service command
1. Start the server
[root@localhost ~] # service vsftpd startStarting vsftpd for vsftpd: [OK] [root@localhost ~] #
2. Restart the server
[root@localhost ~] # service vsftpd restartShutting down vsftpd: [OK] Starting vsftpd for vsftpd: [OK] [root@localhost ~] #
3. Stop the server
[root@localhost ~] # service vsftpd stopShutting down vsftpd: [OK] [root@localhost ~] #
4. Set self-boot.
You can choose to set the vsftpd service to boot, you can use the chkconfig command, or you can customize the startup script. The author uses the chkconfig command. Chkconfig can set boot up for each of the running levels of linux.
0: indicates 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: multi-user mode with graphical interface
6: restart
4.1View the boot status of vsftpd service
[root@localhost ~] # chkconfig | grep vsftpdvsftpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off [root@localhost ~] #
4.2 modify vsftpd boot boot
We only set the boot level to 35 and start the vsftpd service automatically.
[root@localhost ~] # chkconfig-level 35 vsftpd on [root@localhost ~] # chkconfig | grep vsftpdvsftpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off [root@localhost ~] #
Vsftpd Firewall Settings
The vsftpd service listens on ports 20 and 21 by default. If other computers want to access it, they need to release the firewall port or turn off the firewall. Turning off the firewall is not recommended.
Vsftpd transmits data using PASV security mode by default, so you need to set the upper and lower limit of PASV port and release the port.
1. Set the upper and lower limits of PASV ports.
Edit the configuration file: / etc/vsftpd/vsftpd.conf, with two lines appended at the end of the file:
# set PASV port lower limit pasv_min_port=61000# set PASV port upper limit pasv_max_port=62000
2. Release the firewall port
Edit the configuration file: / etc/sysconfig/iptables, adding the following configuration:
-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 20-j ACCEPT-An OUTPUT-m state-- state NEW-m tcp-p tcp-- dport 20-j ACCEPT-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 21-j ACCEPT-An OUTPUT-m state-- state NEW-m tcp-p tcp-dport 21-j ACCEPT-An INPUT-m state-state NEW-m tcp-p tcp-dport 61000 state 62000-j ACCEPT-An OUTPUT -m state-- state NEW-m tcp-p tcp-- dport 61000 tcp 62000-j ACCEPT
3. Restart the service
Restart the vsftpd service and firewall
[root@localhost ~] # service vsftpd restartShutting down vsftpd: [OK] Starting vsftpd for vsftpd: [OK] [root@localhost ~] # service iptables restartiptables: Setting chains to policy ACCEPT: filter [OK] iptables: Flushing firewall rules: [OK] iptables: Unloading modules: [OK] iptables: Applying firewall rules: [OK] [root@localhost ~] # Thank you for reading. This is the content of "how linux checks whether vsftpd is installed". After studying this article I believe that you have a deeper understanding of how linux checks whether vsftpd is installed, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.