Centos X64 6.9版本安装postfix2.6.6+dovecot+openwebmail

Centos X64 6.9版本安装postfix2.6.6+dovecot+openwebmail

测试完成日期:2017.06.07

附件为配置文件,可以直接使用


使用系统自带的帐号、密码文件进行认证,不用安装mysql,方法简单。

测试发现Centos 6.5\6.9 x64都使用SHA-512加密。


注意:请不要在ADSL动态IP线路上架设邮件服务器,会被当成垃圾邮件服务器的。建议用阿里云、腾讯云等VPS服务器,固定IP地址的线路。


一、先卸载sendmail

[root@ser ~]# yum remove sendmail

# chkconfig sendmail off


二、安装postfix,dovecot,cyrus-sasl

[root@ser ~]# yum -y install epel-release

[root@ser ~]# yum -y install postfix perl

[root@ser ~]# yum -y install dovecot dovecot-devel dovecot-mysql pam-devel

[root@ser ~]# yum -y install cyrus-sasl cyrus-sasl-plain cyrus-sasl-md5 cyrus-sasl-lib


查看postfix版本

[root@host]# rpm -qa |grep postfix

postfix-2.6.6-8.el6.x86_64


postfix配置文件

[root@ser ~]#vi /etc/postfix/main.cf


alias_database = hash:/etc/postfix/aliases

alias_maps = hash:/etc/postfix/aliases

queue_directory = /var/spool/postfix

command_directory = /usr/sbin

daemon_directory = /usr/libexec/postfix

data_directory = /var/lib/postfix

mail_owner = postfix

myhostname = mail.dongying.com

mydomain = dongying.com

myorigin = $mydomain

inet_interfaces = all

inet_protocols = ipv4

mydestination = $myhostname,localhost.$mydomain,$mydomain,dongying.com

unknown_local_recipient_reject_code = 550

mynetworks = 127.0.0.0/8,120.25.162.161/32,192.168.88.0/24

smtpd_banner= "Version not Available"

relay_domains = $mydomain

disable_vrfy_command=yes

broken_sasl_auth_clients = yes

smtpd_helo_required = yes
strict_rfc821_envelopes = yes
smtpd_reject_unlisted_sender = no
smtpd_data_restrictions = reject_unauth_pipelining

header_checks = pcre:/etc/postfix/header_checks

smtpd_error_sleep_time = 1s

smtpd_soft_error_limit = 10

smtpd_hard_error_limit = 10

smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

smtpd_delay_reject=yes

smtpd_client_restrictions = permit_sasl_authenticated

smtpd_sasl_path = smtpd

smtpd_sasl_authenticated_header = yes

smtpd_sasl_local_domain = $myhostname


smtpd_sender_restrictions = permit_mynetworks,

reject_non_fqdn_sender,
reject_unknown_sender_domain,
reject_unauthenticated_sender_login_mismatch,
reject_rhsbl_sender dbl.spamhaus.org,
reject_rhsbl_client dbl.spamhaus.org,
permit

smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,188);"> reject_invalid_hostname,reject_non_fqdn_sender,188);"> reject_non_fqdn_recipient,reject_non_fqdn_hostname,188);"> reject_unknown_sender_domain,188);"> reject_unauth_pipelining,reject_unauth_destination,188);"> check_client_access hash:/etc/postfix/client_checks,188);"> check_sender_access hash:/etc/postfix/sender_checks,188);"> reject_rbl_client cblless.anti-spam.org.cn,188);"> reject_rbl_client zen.spamhaus.org,

reject_rbl_client bl.spamcop.net,188);"> reject_rbl_client dyna.spamrats.com,188);"> reject_rbl_client auth.spamrats.com,188);"> reject_rbl_client cbl.abuseat.org,188);"> check_policy_service unix:private/policy-spf,permit

message_size_limit = 41943040

mailbox_size_limit = 500000000



main.cf参数说明如下:

一、注意,以下四行,为你公司的域名及IP信息,请按你实际地址来更改好。

myhostname = mail.dongying.com

mydomain = dongying.com

mydestination = $myhostname,dongying.com

mynetworks = 127.0.0.0/8,192.168.88.0/24


二、注意,以下六行,为反垃圾邮件规则,使用国际反垃圾邮件联盟的域名,经过本人亲自测试,均为有效域名,所以一定要加上。

reject_rbl_client cblless.anti-spam.org.cn,

reject_rbl_client zen.spamhaus.org,155);"> reject_rbl_client bl.spamcop.net,155);"> reject_rbl_client dyna.spamrats.com,155);"> reject_rbl_client auth.spamrats.com,155);"> reject_rbl_client cbl.abuseat.org,


三、对拒绝服务攻击的防范。下面三行参数

smtpd_error_sleep_time = 1s

smtpd_soft_error_limit = 10

smtpd_hard_error_limit = 10


#postfix能累计客户端曾经发生错误的次数,对于可疑的客户端,postfix会主动延迟响应的时间

而且错误次数越多,延迟时间越长。这些都是通过下面的参数进行设置

参数说明:初次的延迟时间由smptd_error_sleep_time参数决定(默认1秒),当客户端累积了

smtpd_soft_error_limit次错误之后,往后每发生一次错误,postfix就多延迟1秒,当错误次数

超过smtpd_hard_error_limit时,postfix就放弃该客户端,并主动断线


四、黑白名单的配置,减少重要客户邮件被当成垃圾邮件。下面二行参数

check_client_access hash:/etc/postfix/client_checks,155);">check_sender_access hash:/etc/postfix/sender_checks,

postfxi里有2个完全不同的参数来实现白名单黑名单,client_checks,通过客户端ip,ip段或主机名屏蔽.

sender_checks,通过判断发件人邮件地址(位于from段)屏蔽,建议将经常来往客户的邮箱域名地址加入到sender_checks文件中去。 ok为允许,reject为拒绝.

上面2个文件只要有修改,记得运行postmap命令,以便postfix能能查找得到

[root@ postfix]#postmap /etc/postfix/client_checks

[root@ postfix]#postmap /etc/postfix/sender_checks


[root@ postfix]# cat sender_checks

gmail.com ok

example.com REJECT env. from addr any@example.com rejected

.example.com REJECT env. from addr any@sub.example.com rejected

user@example.com REJECT We don't want your email


[root@ postfix]# cat client_checks

61.145.211.19 ok

.example.com REJECT No spammers,from your subdomain


五、SPF反垃圾邮件认证。

check_policy_service unix:private/policy-spf

指定域名的spf认证,需要在域名中心做“txt域名解析记录”


六、邮件头查检,过滤指定内容的邮件。

header_checks = pcre:/etc/postfix/header_checks

邮件头查检,spf认证没通过的邮件,直接丢弃

[root@ postfix]# cat /etc/postfix/header_checks

/Received-SPF: softfail/ REJECT


七、邮箱大小及附件的设定。

message_size_limit = 41943040

mailbox_size_limit = 500000000

是限制使用者邮件目录的大小,也就是能够在服务器上保存邮件的大小500M,那么message_size_limit限制邮件大小是41943040/1024/1024=40M,

附件main.cf文件为加入了spf反垃圾验证,可直接使用


八、生成/etc/postfix/aliases别名数据库,解决出现NIS domain name not set - NIS lookups disabled警告信息

[root@ postfix]#touch /etc/postfix/aliases

[root@ postfix]#postalias /etc/postfix/aliases

下面2行加入到main.cf中即可

alias_database = hash:/etc/postfix/aliases

alias_maps = hash:/etc/postfix/aliases


==========================================================================

再进行下面的配置

Postfix配置SPF防发件人欺骗

http://www.haiyun.me/archives/postfix-spf-spoof.html(参考文章)


首先,需要进入公网的“域名管理中心”,加一笔TXT记录,值为 v=spf1 mx -all

同时将MX等记录也配置好,方便收发邮件。按下图设定5项红色框中的即可

wKioL1k5GCbRB8ixAAFB7K-HnH4066.jpg

[root@ postfix]#yum install perl-Mail-SPF perl-Sys-Hostname-Long


[root@ postfix]#wget https://launchpad.net/postfix-policyd-spf-perl/trunk/release2.010/+download/postfix-policyd-spf-perl-2.010.tar.gz



[root@ postfix]#tar zxvf postfix-policyd-spf-perl-2.010.tar.gz


[root@ postfix]#mv postfix-policyd-spf-perl-2.010/postfix-policyd-spf-perl /usr/sbin/


[root@ postfix]#chmod +x /usr/sbin/postfix-policyd-spf-perl


开启postfix-policyd-spf-perl服务:

[root@ postfix]#vi /etc/postfix/master.cf

## spf check

policy-spf unix - n n - - spawn

user=nobody argv=/usr/sbin/postfix-policyd-spf-perl


编辑Postfix主配置文件添加SPF过滤规则:

[root@ postfix]#vi /etc/postfix/main.cf

smtpd_recipient_restrictions =

permit_mynetworks,155);"> ........

check_policy_service unix:private/policy-spf,permit



查看邮件日志

[root@ postfix]#tail -f /var/log/maillog

#下为正确的记录,如下,有红色Received-SPF: pass表示通过。


Jun 7 17:25:56 host-cn postfix/smtpd[12947]: connect from smtpbg331.qq.com[14.17.43.223]

Jun 7 17:26:04 host-cn postfix/policy-spf[12952]: Policy action=PREPEND Received-SPF: pass (qq.com: Sender is authorized to use '3700488@qq.com' in 'mfrom' identity (mechanism 'include:spf.mail.qq.com' matched)) receiver=unknown; identity=mailfrom; envelope-from="3700488@qq.com"; helo=smtpbg331.qq.com; client-ip=14.17.43.223

Jun 7 17:26:04 host-cn postfix/smtpd[12947]: 05CBEC0E16: client=smtpbg331.qq.com[14.17.43.223]

Jun 7 17:26:04 host-cn postfix/cleanup[12955]: 05CBEC0E16: message-id=<tencent_59D1E18B1E12DC422D21A8AA@qq.com>

Jun 7 17:26:04 host-cn postfix/qmgr[12946]: 05CBEC0E16: from=<3700488@qq.com>,size=2286,nrcpt=1 (queue active)

Jun 7 17:26:04 host-cn postfix/smtpd[12947]: disconnect from smtpbg331.qq.com[14.17.43.223]

Jun 7 17:26:04 host-cn postfix/local[12956]: 05CBEC0E16: to=<evan@dongying.com>,relay=local,delay=7.6,delays=7.6/0.01/0/0.01,dsn=2.0.0,status=sent (delivered to mailbox)

Jun 7 17:26:04 host-cn postfix/qmgr[12946]: 05CBEC0E16: removed


#以下为错误信息

postfix/policy-spf[15857]: Policy action=PREPEND Received-SPF: softfail (www.haiyun.me: Sender is not authorized by default


将postfix加入到root组

[root@ postfix]# usermod -G root postfix

再检查配置文件,执行命令 /usr/sbin/postconf -n



将postfix设定为MTA

[root@ postfix]#alternatives �Cset mta /usr/sbin/sendmail.postfix

查看MTA的方法:

[root@ postfix]#alternatives --display mta

将Postfix设置为自启动

[root@ postfix]#chkconfig --add postfix

[root@ postfix]#chkconfig postfix on 

[root@ postfix]#chkconfig saslauthd on


查看是否有安装认证 

[root@ postfix]# rpm -qa|grep cyrus

cyrus-sasl-lib-2.1.23-15.el6_6.2.x86_64

cyrus-sasl-md5-2.1.23-15.el6_6.2.x86_64

cyrus-sasl-devel-2.1.23-15.el6_6.2.x86_64

cyrus-sasl-2.1.23-15.el6_6.2.x86_64

cyrus-sasl-plain-2.1.23-15.el6_6.2.x86_64


配置认证机制, 在文件内容中加入如下三行

[root@ postfix]#vi /etc/sasl2/smtpd.conf

log_level: 3

pwcheck_method: saslauthd

mech_list: plain login


[root@ postfix]#vi /etc/sysconfig/saslauthd 在文件内容中,有如下两行

MECH=shadow

FLAGS=


再启动认证服务

[root@ postfix]#service saslauthd start


添加邮件用户的账户
[root@ postfix]# groupadd mail 新建立一个mail用户组
[root@ postfix]#useradd -g mail -s /sbin/nologin evan 建evan用户并指定用户组为mail组,且不让其SSH登录
[root@ postfix]#passwd evan 修改evan用户密码


为了使添加的邮箱用户有在/var/spool/mail目录下的权限,需要:

[root@ postfix]#usermod -g mailevan 修改evan用户,设置主用户组为mail组


查看mail组中的用户

[root@host-cn ~]# groups mail
mail :jack evan


查看Linux某用户属于哪个组

[root@host-cn postfix]# id evan

uid=504(evan) gid=12(mail) groups=12(mail)

[root@host-cn postfix]# groups evan

evan : mail


当用户已经建立了,如果你在建立时没有控制权限,现在需要取消用户登录权限,可以使用以下命令
vi /etc/passwd
找到你要修改的用户所在的那一行,例如username:x:502:502::/home/username:/bin/bash
修改为以下代码
username:x:502:502::/home/username:/sbin/nologin


验证密码是否成功,格式如下,例如:

[root@ postfix]#testsaslauthd -u evan -p miserp007

0: OK "Success."

显示上面结果,表示验证成功。


启动postfix服务

[root@ postfix]# service postfix start


==================================================================================

二、安装与配置dovecot

[root@ postfix]#yum install -y dovecot dovecot-devel dovecot-mysql pam-devel


查看版本

[root@ postfix]#dovecot --version

2.0.9


只需要配置一个dovecot.conf文件即可,进行普通认证,关掉SSL

[root@ dovecot]#vi /etc/dovecot/dovecot.conf

listen = *

protocols = pop3 imap

default_login_user=postfix

default_internal_user=postfix

disable_plaintext_auth = no

ssl = no

mail_privileged_group = mail

mail_location = mbox:~/mail:INBOX=/var/mail/%u

userdb {

driver = passwd

args = blocking=no

}

passdb {

driver = shadow

}


将conf.d文件夹改名,不需要使用里面的配置文件

[root@dovecot]#cd /etc/dovecot/

[root@dovecot]#mv conf.d conf.d.bak


检查认证文件,默认是不需要更改的

[root@dovecot]#vi /etc/pam.d/dovecot

auth required pam_nologin.so

auth include password-auth

account include password-auth

session include password-auth


将dovecot设置为自启动

[root@dovecot]#service dovecot start  

[root@dovecot]#chkconfig dovecot on

[root@dovecot]# chkconfig --add dovecot


测试是否可以正常登录dovecot

[root@dovecot]# telnet localhost 110

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

+OK Dovecot ready.

user evan 手动打入登录用户名

+OK

pass miserp007 手动打入用户密码

+OK Logged in. 此处表示已经登录进来了

quit 退出去

+OK Logging out.


查看邮件日志

[root@dovecot]#tail -f /var/log/maillog


============================================================================

三、安装openwebmail


生成openwebmail安装源

[root@dovecot]#vi /etc/yum.repos.d/openwebmail.repo

[openwebmail]

## Thomas Chung

## 2008.05.29

name=Openwebmail for Fedora or Enterprise Linux

baseurl=http://openwebmail.org/openwebmail/download/redhat/rpm/release/

enabled=1

gpgcheck=1

gpgkey=http://openwebmail.org/openwebmail/download/redhat/rpm/release/RPM-GPG-KEY-openwebmail

#metadata_expire=0


[root@dovecot]#yum install openwebmail

安装完成后,提示运行openwebmail-tool.pl --init

[root@dovecot]# cd/var/www/cgi-bin/openwebmail/

更改dbm.conf内容后保存

[root@openwebmail]#vi /var/www/cgi-bin/openwebmail/etc/dbm.conf  

dbm_ext .db

dbmopen_ext .db

dbmopen_haslock no


[root@openwebmail]# cd /var/www/cgi-bin/openwebmail/

执行初始化

[root@openwebmail]#./openwebmail-tool.pl --init


Send the site report?(Y/n) 请回答y

最后完成安装过程


修改openwebmail语言选项

[root@openwebmail]# cd /var/www/cgi-bin/openwebmail/etc

[root@ etc]# vi openwebmail.conf

domainnames dongying.com 将auto改成你公司的域名,此处为dongying.com

default_language auto 将en改成auto

default_iconset Cool3D.Chinese.Simplified


[root@ etc]#cd /var/www/cgi-bin/openwebmail/etc/defaults

[root@ defaults]#domainnames dongying.com

smtpserver 127.0.0.1


让 Open WebMail 成为 Server 预设的网页

[root@ defaults]#cd /var/www/cgi-bin/openwebmail

[root@openwebmail]#vi index.html


<html><head>

<meta http-equiv="Refresh"

content="0;URL=http://mail.dongying.com:82/cgi-bin/openwebmail/openwebmail.pl">

</head></html>


安装apache并修改配置文件

[root@openwebmail]# yum install httpd

[root@openwebmail]#vi /etc/httpd/conf/httpd.conf

ServerName mail.dongying.com:82

Listen 82

DocumentRoot "/var/www/cgi-bin/openwebmail"

AddHandler cgi-script .cgi .pl


安装字符编码
[root@openwebmail]#wget ftp://ftp.devil-linux.org/pub/devel/sources/1.4/perl-ext/MIME-Base64-3.09.tar.gz

[root@ ~]# tar -xzvf MIME-Base64-3.09.tar.gz
[root@ ~]# cd MIME-Base64-3.09
[root@ MIME-Base64-3.09]# perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for MIME::Base64

[root@ MIME-Base64-3.09]# make


[root@openwebmail]#service httpd restart


加入到自动启动

[root@openwebmail]# chkconfig httpd on


停用防火墙或者加入指定端口25、82、110、143、

[root@openwebmail]# service iptables stop

[root@openwebmail]#vi /etc/sysconfig/iptables

-A INPUT -p tcp -m tcp --dport 25 -j ACCEPT

-A INPUT -p tcp -m tcp --dport 110 -j ACCEPT

-A INPUT -p tcp -m tcp --dport 143 -j ACCEPT

-A INPUT -p tcp -m tcp --dport 82 -j ACCEPT

[root@openwebmail]#service iptables restart


再就可以在浏览器中直接打开了



http://mail.dongying.com:82


===========================================================

定期备份maillog文件并删除15天以前的旧备份文件,用于防止maillog文件过大,造成硬盘空间的浪费
[root@postfix]# vi /etc/posftix/clearmaillog
#!/bin/sh
# clear maillog and Backup .by evanli
rq=`date +%Y-%m-%d`
service postfix stop
service dovecot stop
mv /var/log/maillog /var/log/maillog-$rq.bak
service rsyslog restart
service postfix start
service dovecot start
find /var/log -mtime +15 -name "mail*.bak" -exec rm -rf {} \;


生成的备份日志文件格式为maillog-2017-06-08.bak


给予可执行权限
[root@ postfix]# chmod +x clearmaillog


安装排程与时间同步服务
[root@postfix]# yum install crontabs ntpdate


停用系统自带的ntpd服务
[root@postfix]# service ntpd stop
[root@postfix]# chkconfig ntpd off


将以下红色2行加入到文件最后
[root@host-cn postfix]# vi /etc/crontab
55 23 * * 0 root /etc/postfix/clearmaillog
0 */1 * * * root /usr/sbin/ntpdate 0.pool.ntp.org >& /dev/null


每周日晚上23:55分,备份miallog并清除旧文件。
每隔1小时同步一次系统时间


重起一次排程服务
[root@ postfix]# /sbin/service crond restart


====================================================

邮件日志分析工具pflogsumm

1、pflogsumm功能:
统计接收、投递、转发、延时、反弹、拒绝、保留、丢弃的邮件
统计发件人和收件人
统计发送和接受方主机/域名
统计SMTPD连接数
。。。。。。

2、安装
# yum install postfix-pflogsumm


3、使用
统计今天的信息
# pflogsumm -d today /var/log/maillog


统计昨天的信息
# pflogsumm -d yesterday /var/log/maillog


4、使用定时任务生成j昨天报告

每天晚上23:53点,将当天的邮件系统日志统计报表发送到管理员邮箱中去。

将以下面一行加入到文件最后

[root@ postfix]# vi /etc/crontab

53 23 * * * root /usr/sbin/pflogsumm -d today /var/log/maillog 2>&1 | mail -s "daily mail stats" evan@dongying.com


更多 pflogsumm使用方法:
# man pflogsumm


最后,使用outlook2013或foxmail来收邮件时,一定要记得,将“我的发件服务器(STMP)需要验证”打上勾。另外,用户名位置一定要按图设定。 如下图

wKioL1k5GBGjlkqPAAG1SjzvEXg346.jpg

测试完成日期:2017.06.07

附件为配置文件,可以直接使用

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


linux下开机自启: 在/etc/init.d目录下新建文件elasticsearch 并敲入shell脚本: 注意, 前两行必须填写,且要注释掉。 第一行为shell前行代码,目的告诉系统使用shell。 第二行分别代表运行级别、启动优先权、关闭优先权,且后面添加开机服务会用到。 shell脚本
1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以需要赋予其可执行权 chmod +x /etc/rc.d/rc.local 2、赋予脚本可执行权限假设/usr/local/script/autostart.sh是你的脚本路径,给予执行权限 chmod +x /usr
最简单的查看方法可以使用ls -ll、ls-lh命令进行查看,当使用ls -ll,会显示成字节大小,而ls- lh会以KB、MB等为单位进行显示,这样比较直观一些。 通过命令du -h –max-depth=1 *,可以查看当前目录下各文件、文件夹的大小,这个比较实用。 查询当前目录总大小可以使用d
ASP.NET Core应用程序发布linux在shell中运行是正常的。可一但shell关闭网站也就关闭了,所以要配置守护进程, 用的是Supervisor,本文主要记录配置的过程和过程遇到的问题 安装Supervisor&#160;1 yum install python-setuptools
设置时区(CentOS 7) 先执行命令timedatectl status|grep &#39;Time zone&#39;查看当前时区,如果不是时区(Asia/Shanghai),则需要先设置为中国时区,否则时区不同会存在时差。 #已经是Asia/Shanghai,则无需设置 [root@xia
vim&#160;/etc/sysconfig/network-scripts/ifcfg-eth0 BOOTPROTO=&quot;static&quot; ONBOOT=yes IPADDR=192.168.8.106 NETMASK=255.255.252.0 GATEWAY=192.168.
一、安装gcc依赖 由于 redis 是用 C 语言开发,安装之前必先确认是否安装 gcc 环境(gcc -v),如果没有安装,执行以下命令进行安装 [root@localhost local]# yum install -y gcc 二、下载并解压安装包 [root@localhost local
第一步 On CentOS/RHEL 6.*: $ sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el6/x86_64/nux-dextop-release-0-2.el6.nux.noarch.rpm On CentOS/RHEL 7: $
/// &lt;summary&gt; /// 取小写文件名后缀 /// &lt;/summary&gt; /// &lt;param name=&quot;name&quot;&gt;文件名&lt;/param&gt; /// &lt;returns&gt;返回小写后缀,不带“.”&lt;/ret
which nohup .bash_profile中并source加载 如果没有就安装吧 yum provides */nohup nohup npm run start &amp; nohup ./kibana &amp;
1.1 MySQL安装 1.1.1 下载wget命令 yum -y install wget 1.1.2 在线下载mysql安装包 wget https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm 1.1.3 安装My
重启 reboot shutdown -r now init 6 关闭 init 0 shutdown -h now shutdown -h 20:25 #8点25关机查看内存 free CPU利用率 top 日期 date 设置时间 date 033017002015 #月日时间年 日历 cal
1、firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status firewalld 开机禁用 : systemctl disable firewalld 开机启用 :
1 下载并安装MySQL官方的&#160;Yum Repository wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm 使用上面的命令就直接下载了安装用的Yum Repository,大概
CentOS6.x CentOS6中转用Upstrat代替以前的init.d/rcX.d的线性启动方式。 一、相关命令 通过initctl help可以查看相关命令 [root@localhost ~]# initctl help Job commands: start Start job. sto
1、使用命令:df -lk 找到已满磁盘 2、使用命令:du --max-depth=1 -h 查找大文件,删除
ifconfig:查看网卡信息 网卡配置文件位置: /etc/sysconfig/network-scripts/文件夹 nmtui:配置网卡 netstat -tlunp:查看端口信息 端口信息存储位置: /etc/services文件 route:查看路由信息 wget:下载网路文件,例如 wg
ps -ef:查看所有进程,&#160;ps -ef |grap firewalld 查看与firewalld相关的进程 which :查看进程:which firewalld kill 进程id:杀掉进程 kill 640,强制杀:kill -9 640 man:查看帮助,例如 man ps 查看
useradd:添加用户 useradd abc,默认添加一个abc组 vipw:查看系统中用户 groupadd:添加组groupadd ccna vigr:查看系统中的组 gpasswd:将用户abc添加到ccna组 gpasswd -a abc ccna groups abc:查看用户abc属