“Linux:系统管理”的版本间差异

来自Shiyin's note
跳到导航 跳到搜索
无编辑摘要
第19行: 第19行:


==ftp服务器==
==ftp服务器==
*yum install vsftpd
#yum install vsftpd
*systemctl start vsftpd
#systemctl start vsftpd
*vim /etc/vsftp/vsftp.conf (fc20)
#vim /etc/vsftp/vsftp.conf (fc20)
:#anonymous_enable=NO ;不允许匿名访问
:*anonymous_enable=NO ;不允许匿名访问
:#增加local_root=/var/ftp ;以用户名登陆后默认是自己的home directory
:*增加local_root=/var/ftp ;以用户名登陆后默认是自己的home directory
:#chmod 777 /var/ftp
:*chmod 777 /var/ftp
:#setsebool allow_ftpd_full_access 1 ;SELinux
:*setsebool allow_ftpd_full_access 1 ;SELinux
:#firewall-cmd --permanent --add-port=21/tcp
:*firewall-cmd --permanent --add-port=21/tcp
:#firewall-cmd --permanent --add-service=ftp
:*firewall-cmd --permanent --add-service=ftp
:#firewall-cmd --reload
:*firewall-cmd --reload


==系统清理==
==系统清理==

2015年5月18日 (一) 14:50的版本

双机备份

磁盘配额

SE Linux 环境下网络服务设置

简单的做法

  • getenforce 查看SE linux状态
  • setenforce 0 临时关闭SElinux
  • sealert 查看SELinux的警告
sealert -a /var/log/audit/audit.log (命令行)

Apache 配置

  • 日志文件 /var/log/httpd/error_log

cups打印服务器

http://localhost:631/

ftp服务器

  1. yum install vsftpd
  2. systemctl start vsftpd
  3. vim /etc/vsftp/vsftp.conf (fc20)
  • anonymous_enable=NO ;不允许匿名访问
  • 增加local_root=/var/ftp ;以用户名登陆后默认是自己的home directory
  • chmod 777 /var/ftp
  • setsebool allow_ftpd_full_access 1 ;SELinux
  • firewall-cmd --permanent --add-port=21/tcp
  • firewall-cmd --permanent --add-service=ftp
  • firewall-cmd --reload

系统清理

  • /var/log/btmp文件巨大,有450M
该文件记录的是不成功的登录(即偶的电脑被攻击的次数!_!),可用lastb查看btmp会持续增长,以后应该注意清理。
与此对应的文件是/var/log/wtmp,这是成功的登录记载,用last查看。wtmp似乎不会持续增长。
  • 在fc6中,/var/cache/logwatch目录巨大,同样有约450M。这是logwatch服务的记录目录。
可用/usr/sbin/logwtach --print查看各项事件记录。usr/sbin/logwtach --help查看使用帮助。同样是关于secure的内容记载最多。
  • /var/log/jounral下面的文件巨多,可以删除(man systemd-journald.service)
可以通过设置/etc/systemd/journald.conf来限制日志文件的大小(man journald.conf)
[Journal]
SystemMaxUse=16M
ForwardToSyslog=no