FTP服务搭建

tech2022-09-14  97

一、FTP服务搭建

1、安装vsftpd服务 yum -y install vsftpd 2、修改配置文件 vi /etc/vsftpd/vsftpd.conf anon_root=/opt 3、启动服务 systemctl restart vsftpd 4、使用浏览器登录验证 ftp://+192.168.100.10 5、客户端使用FTP源 cat /etc/yum.repos.d/lcoal.repo [centos] name=centos baseurl=ftp://192.168.100.10/centos gpgcheck=0 enabled=1 6、验证yum源 cat /etc/yum.repos.d/lcoal.repo [centos] name=centos baseurl=ftp://192.168.100.10/centos gpgcheck=0 7、[root@localhost ~]# yum clean all Loaded plugins: fastestmirror Cleaning repos: centos Cleaning up everything Cleaning up list of fastest mirrors 8、[root@localhost ~]# yum repolist Loaded plugins: fastestmirror centos | 3.6 kB 00:00 (1/2): centos/group_gz | 155 kB 00:00 (2/2): centos/primary_db | 2.8 MB 00:00 Determining fastest mirrors repo id repo name status centos centos 3,723 repolist: 3,723

二、NFS服务配置 1、安装NFS相关服务,两台节点操作 yum -y install nfs-utils rpcbind

2、编辑配置文件 vi /etc/exports /mnt/test 192.168.100.0/24(rw,no_root_squash,no_all_squash,sync,anonuid=501,anongid=501) rw 读写 ro 只读 sync 同步 内存和磁盘实时同步 async 非同步HGFDSA root_squash root 限制了root用户 no_root_squash root 用户对共享的目录具有最高权限 all_squash 任何用户使用NFS都被限定为普通用户身份 no_all_squash 不限定用户身份 anonuid uid anongid gid 3、创建共享的目录 mkdir /mnt/test 4、生效配置文件 exportfs -r 5、服务端可挂载的NFS服务 showmount -e +服务端地址 6、客户端挂载服务 mount -t nfs 服务端IP:/mnt/test /mnt/ 7、验证挂载 df -h |grep /mnt 192.168.100.10:/mnt/test 36G 880M 35G 3% /mnt 8、验证共享 cd /mnt/ 客户端进入挂载点 [root@localhost mnt]# ll total 0 -rw-r–r--. 1 root root 0 Aug 31 12:08 123.txt 9、计算md5值 md5sum 123.txt 10、查看共享目录 cd /mnt/test/ ll total 0 -rw-r–r--. 1 root root 0 Aug 31 12:08 123.txt 11、计算md5值,和客户端相同 md5sum 123.txt d41d8cd98f00b204e9800998ecf8427e 123.txt

三、CIFS服务 1、单节点安装samba服务 yum -y install samba 2、编辑samba配置文件 vi /etc/samba/smb.conf load printers = no cups options = raw

; printcap name = /dev/null # obtain a list of printers automatically on UNIX System V systems: ; printcap name = lpstat ; printing = bsd disable spoolss = yes 3、创建共享目录 mkdir /opt/share 4、共享目录所有权限 chmod 777 /opt/share 5、启动samba守护进程 systemctl start smb systemctl start nmb 6、创建samba用户密码 sambapasswd -a root 7、Windows下访问验证

四、排错思路 1、防火墙与selinux是否关闭 2、共享目录是否配置出错 3、配置文件修改后是否重启服务 4、虚拟机重启后是否重新挂载 5、客户端配置文件是否出错,服务daunt共享出的目录,在客户端不用再填写 6、网络源是否移除备份 7、挂载不成功查看配置文件掩码信息以及共享参数 8、同步文档不成功查看防火墙与selinux 9、查看smb.conf的配置文件

最新回复(0)