码迷,mamicode.com
首页 > 系统相关 > 详细

linux-第十二课时笔记-[FTP服务器搭建]-[本地FTP]-[02]

时间:2017-09-07 00:04:58      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:images   创建   测试文件   expec   linux   sel   测试   笔记   most   

 

FTP本地服务器搭建

 

yum安装vsftpd服务:

    [root@CrushLinux ~]# yum -y install vsftpd

 

创建本地两个用户:

    [root@CrushLinux ~]# useradd test1

    [root@CrushLinux ~]# useradd test2

    [root@CrushLinux ~]# echo "123" | passwd --stdin test1 &> /dev/null

    [root@CrushLinux ~]# echo "123" | passwd --stdin test2 &> /dev/null

    [root@CrushLinux ~]# id test1

    uid=501(test1) gid=501(test1) groups=501(test1)

    [root@CrushLinux ~]# id test2

    uid=502(test2) gid=502(test2) groups=502(test2)

 

备份配置文件及配置:

备份:

    [root@CrushLinux ~]# cp /etc/vsftpd/vsftpd.conf{,.bak}

    [root@CrushLinux ~]# ls /etc/vsftpd/

    ftpusers  user_list  vsftpd.conf  vsftpd.conf.bak   vsftpd_conf_migrate.sh

 

配置:

     20 # Default umask for local users is 077. You may wish to change this to 022,

     21 # if your users expect that (022 is used by most other ftpd‘s)

     22 local_umask=077   //777-077=700 只允许属主可读可写

     96 chroot_local_user=YES  //锁定用户的家目录(以用户的家目录作为根)

 

开启服务及关闭防火墙及selinux:

    [root@CrushLinux vsftpd]# /etc/init.d/vsftpd start

    Starting vsftpd for vsftpd:     [  OK  ]

    [root@CrushLinux vsftpd]# service iptables stop

    [root@CrushLinux vsftpd]# setenforce 0

    setenforce: SELinux is disabled

 

创捷测试文件标记:

    [root@CrushLinux vsftpd]# touch /home/test1/test1.txt #测试文件

    [root@CrushLinux vsftpd]# touch /home/test2/test2.txt #测试文件

 

验证结果:

Test1:

     技术分享

 

Test2:

     技术分享

 

linux-第十二课时笔记-[FTP服务器搭建]-[本地FTP]-[02]

标签:images   创建   测试文件   expec   linux   sel   测试   笔记   most   

原文地址:http://www.cnblogs.com/msl23/p/7487399.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!