CentOS命令大全 包括:系统命令,各种服务器搭建等

2020-01-30 13:12:53王振洲



文件结构:
DEVICE=eth0 //指出设备名称
ONBOOT=yes//是否启动应用
BOOTPROTO=static //启动类型 静态 (默认dhcp)
IPADDR=192.168.0.77 //IP地址
NETMASK=255.255.255.0//子网掩码
GATEWAY=192.168.0.1 //网关
步骤:
1、vi /etc/sysconfig/network-scripts/ifcfg-teh0 (也可通过管理工具setup或netconfig命令设置)
2、重新启动网络服务service network restart
要想和主机连接:还需配置xp主机,在vmware上设置为 host-only模式,xp里修改vmnet1的IP地址为192.168.0.1, 修改Linux centos IP为192.168.0.77
共享上网设置:xp里修改第一块虚拟网卡的网络属性为共享internet(属性->高级->钩选“允许其他网络用户通过此计算机的Internet连接来连接”) 会自动把vmnet1改为192.168.0.1,Linux centos就能上网了
CentOS Vsftpd配置经过长时间的发展,这里我发表一下个人理解,下面就这就来讲术CentOS Vsftpd配置。调整CentOS Vsftpd配置文件:
1.编辑CentOS Vsftpd配置文件前先备份
[root@KcentOS5 ~]cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.backup
2.编辑主CentOS Vsftpd配置文件Vsftpd.conf
[root@KcentOS5 ~]vi /etc/vsftpd/vsftpd.conf
这里我将原CentOS Vsftpd配置文件的修改完全记录,凡是修改的地方我都会保留注释原来的配置。其中加入我对每条配置项的认识,对于一些比较关键的配置项这里我做了我的观点,并且原本英语的说明我也不删除,供参考对比用。
Example config file /etc/vsftpd/vsftpd.conf
The default compiled in settings are fairly paranoid. This sample file
loosens things up a bit, to make the ftp daemon more usable.
Please see vsftpd.conf.5 for all compiled in defaults.
READ THIS: This example file is NOT an exhaustive list of vsftpd options.
Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
capabilities.
Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
anonymous_enable=NO
设定不允许匿名访问


Uncomment this to allow local users to log in.
local_enable=YES设定本地用户可以访问。注意:主要是为虚拟宿主用户,如果该项目设定为NO那么所有虚拟用户将无法访问。
Uncomment this to enable any form of FTP write command.
write_enable=YES
设定可以进行写操作。
Default umask for local users is 077. You may wish to change this to 022,
if your users expect that (022 is used by most other ftpd's)
local_umask=022
设定上传后文件的权限掩码。
Uncomment this to allow the anonymous FTP user to upload files. This only
has an effect if the above global write enable is activated. Also, you will
obviously need to create a directory writable by the FTP user.
anon_upload_enable=YES
anon_upload_enable=NO