1. 程式人生 > 其它 >在VM虛擬機器中安裝FTP服務

在VM虛擬機器中安裝FTP服務

自用的話,建議先關掉防火牆

systemctl stop firewalld #關閉防火牆
systemctl disable firewalld.service #設定開機禁用防火牆
systemctl start firewalld #啟動防火牆
systemctl enable firewalld.service #設定開機啟用防火牆
systemctl status firewalld  #檢查防火牆狀態

1. 安裝ftp

yum -y install vsftpd

檢視

vsftpd -v

2. 取消匿名登陸

修改vsftpd.conf檔案

vi /etc/vsftpd/vsftpd.conf

把 anonymous_enable=YES,改為NO,然後重啟vsftpd

3、設定開機啟動

chkconfig vsftpd on

4、啟動ftp服務

service vsftpd start

檢查服務狀態

service vsftpd status

停止服務:

service vsftpd stop

重啟服務

service vsftpd restart

5. vi /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=enforcing # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls
- Multi Level Security protection. #SELINUXTYPE=targeted SELINUX=disabled

6. 關閉防火牆

setenforce 0 #設定SELinux 成為permissive模式 臨時關閉selinux的防火牆

檢視SELinux狀態

getenforce

修改好之後,reboot重啟下,然後執行getenforce命令檢視SELinux狀態

再次檢視SELinux狀態

顯示 Disabled

7.獲取本地IP地址

ip address

找到類似192.168.x.x的IP地址,記下來

8. 連線FTP

開啟xshell,新建會話,輸入192.168.x.x,點選連線,根據提示,輸入使用者名稱密碼即可(使用者名稱是當前使用者root,密碼是進入linux系統的密碼,連線就可以了)。

原文地址:在虛擬機器中安裝ftp_ITPUB部落格