感觉: Centos的安全配置要比Ubuntu复杂一些
1. 安装Centos系统
选择图形界面的CentOs操作上会舒适一点,特别是对linux不是很熟悉的同志。比如me。
2. 安装Gcc
Yum –y install gcc
Yum –y install gcc-c++
3. 安装eclipse IDE for C/C++ Linux Developers(Includes Incubatingcomponents)
配置好网络直接去Eclipse网站,下载解压缩即可.
Indigo地址为: http://www.eclipse.org/downloads/packages/release/indigo/sr2
4. 配置ftpvsftpd
4.1 检查是否安装vsftpd服务
Chkconfig 命令是否存在vsftpd服务,不存在则下载安装
4.1下载安装vsftpd
Yum –y install vsftpd
4.2 配置vsftpd
简单的说,为配置/ect/vsftpd.conf;详细配置见” 笨猪无罪”的vsftpd配置手册,地址为http://zserver.blog.51cto.com/370152/157203
4.3 启动vsftpd
Service vsftpd start
4.4 检验是否能够登录
1) FTP登录报错:500OOPS: cannot change directory
可能是selinux的限制造成.
解决方法(http://www.esojourn.org/blog/read.php/313.htm):
a) 降低SELinux安全级别,把enforcing降低到permissive
vi /etc/sysconfig/selinux
# This file controls the state of SELinux onthe system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=permissive]
然后重启机器
b) 更理想的办法。首先查看SELinux中有关FTP的设置状态:
getsebool -a|grep ftp
allow_ftpd_anon_write --> off
allow_ftpd_full_access -->off
allow_ftpd_use_cifs --> off
allow_ftpd_use_nfs --> off
allow_tftp_anon_write --> off
ftp_home_dir --> off
ftpd_connect_db --> off
ftpd_disable_trans --> on
ftpd_is_daemon --> on
httpd_enable_ftp_server -->off
tftpd_disable_trans --> off
经过尝试发现,打开ftp_home_dir或者 ftpd_disable_trans。都可以达到在enforcing级别下,允许FTP正常登录的效果。
setsebool -P ftp_home_dir1
#CentOS6里,是这样
setsebool -Pallow_ftpd_full_access 1
service vsftpd