Fedora8中VSFtpd服务的配置

# cd /media/Fedora\ 8\ i386\ DVD/Packages/
# find . -name "*vsftpd*"
./vsftpd-2.0.5-19.fc8.i386.rpm
# rpm -ivh vsftpd-2.0.5-19.fc8.i386.rpm
warning: vsftpd-2.0.5-19.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing... ########################################### [100%]
1:vsftpd ########################################### [100%]
# cd /etc
# cd vsftpd/
# ls
ftpusers user_list vsftpd.conf vsftpd_conf_migrate.sh
# cp vsftpd.conf vsftpd.conf.bak
# ls
ftpusers user_list vsftpd.conf vsftpd.conf.bak vsftpd_conf_migrate.sh
1.关闭放火墙
iptables -F
2.设置selinux
SELinux有利也有弊,就算你有root的权限,也不可以乱来.
SELinux(Security-Enhanced Linux) 是美国国家安全局(NAS)对于强制访问控制的实现,是 Linux® 上最杰出的新安全子系统。NSA是在Linux社区的帮助下开发了一种访问控制体系,在这种访问控制体系的限制下,进程只能访问那些在他的任务中所需要文件。SELinux 默认安装在 Fedora 和 Red Hat Enterprise Linux 上,也可以作为其他发行版上容易安装的包得到。
SELinux就如防火墙, Fedora Core 2开始是系统预设了,但是关闭的。FC3是部分开启。
FC5全部开启了。
SELINUX有「disabled」「permissive」,「enforcing」3种选择。
Disabled就不用说了,permissive就是Selinux有效,但是即使你违反了策略的话它让你继续操作,但是把你的违反的内容记录下来。在我们开发策略的时候非常的有用。
相当于Debug模式。
Enforcing就是你违反了策略,你就无法继续操作下去。
/etc/selinux
# vi 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=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0
3.修改目录权限
# cd /var/ftp/
# ll
总计 8
drwxr-xr-x 4 root root 4096 05-16 04:25 pub
# chmod 777 pub/
# ll
总计 8
drwxrwxrwx 4 root root 4096 05-16 04:25 pub
匿名用户
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
是否让anonymous具有上传资料的功能
#anon_upload_enable=YES 注:修改anon_upload_enable=YES
是否让anonymous具有建立目录的权限
#anon_mkdir_write_enable=YES 注:修改anon_mkdir_write_enable=YES
dirmessage_enable=YES  当使用者进入某个目录,会显示该目录需要注意的内容
xferlog_enable=YES   使用者上传下载档案都会被记录起来
connect_from_port_20=YES
#chown_uploads=YES
#chown_username=whoever
#xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
#idle_session_timeout=600
#data_connection_timeout=120
listen=YES   表示vsftpd是以standalone的方式来启动的
#listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
新建用户,给予用户的
先把anonymous_enable=YES 设置为NO
# adduser TuxA 注:建立一个新用户
# passwd TuxA
Changing password for user TuxA.
新的 UNIX 口令:
重新输入新的 UNIX 口令:
passwd: all authentication tokens updated successfully.
# ftp 192.168.1.6
Connected to 192.168.1.6 (192.168.1.6).
220 (vsFTPd 2.0.5)
Name (192.168.1.6:root): TuxA
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (192,168,1,6,116,217).
150 Here comes the directory listing.
226 Directory send OK.
ftp> mkdir jw 注:建立jw目录
257 "/home/TuxA/jw" created
ftp> ls
227 Entering Passive Mode (192,168,1,6,96,19).
150 Here comes the directory listing.
drwxr-xr-x 2 501 501 4096 May 15 21:30 jw
226 Directory send OK.
ftp> rm jw 注:删除jw目录
250 Remove directory operation successful.
ftp> ls
227 Entering Passive Mode (192,168,1,6,209,254).
150 Here comes the directory listing.
226 Directory send OK.
ftp> exit
221 Goodbye.
#
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值