http和https使用的是完全不同的連接方式,用的端口也不一樣,前者是80,后者是443。http的連接很簡單,是無狀態(tài)的, HTTPS協(xié)議是由SSL+HTTP協(xié)議構(gòu)建的可進(jìn)行加密傳輸、身份認(rèn)證的網(wǎng)絡(luò)協(xié)議 要比http協(xié)議安全
默認(rèn)情況下,find命令遞歸的遍歷整個目錄樹。非常消耗時間和資源。然而,可以指定目錄遍歷的深度。例如,我們不想遍歷2,3級子目錄,這可以使用maxdepth選項完成。
#find ./test-maxdepth 2 -name'*.php'
./test/cool.php
./test/subdir/how.php
#find ./test-maxdepth 1 -name'*.php'
./test/cool.php
第二個示例使用maxdepth 1選項,它意味著不會搜索超過1級深度,僅在當(dāng)前目錄中。
當(dāng)我們希望限制搜索僅在當(dāng)前目錄或最大1級深度子目錄,這很有用,不必搜索整個目錄,而這將需要大量時間 。
就像maxdepth一樣,有一個名為mindepth的選項可以實現(xiàn)如其名稱所暗示的功能,它將至少搜索n級深度。
>/dev/null刪除
mkdir新建文件夾
chmod 644 /etc/passwd配置權(quán)限
passwd命令 https://www.runoob.com/linux/linux-comm-passwd.html
Linux主機(jī)安全配置規(guī)范
一、賬號口令
1 配置口令最小長度
?在文件/etc/login.defs中設(shè)置 PASS_MIN_LEN,參考值:8
2?配置口令生存周期
? ?在文件/etc/login.defs中設(shè)置 PASS_MAX_DAYS,參考值:90
3?配置密碼復(fù)雜度策略
??CentOS系統(tǒng):修改/etc/pam.d/system-auth文件,?在ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1 選3種,追加到password requisite pam_cracklib.so后面,添加到配置文件中。
例如:password requisite pam_cracklib.so ucredit=-1 lcredit=-1 dcredit=-1
注:ucredit:大寫字母個數(shù);lcredit:小寫字母個數(shù);dcredit:數(shù)字個數(shù);ocredit:特殊字符個數(shù)
4 限定用戶su到root
? ??編輯su文件(vi /etc/pam.d/su),在開頭添加下面兩行:
auth sufficient pam_rootok.so
auth required pam_wheel.so group=wheel
? ? 這表明只有wheel組的成員可以使用su命令成為root用戶。?
二、認(rèn)證授權(quán)
1?設(shè)置文件與目錄缺省權(quán)限
? ??在文件/etc/profile中設(shè)置umask 默認(rèn):022,可改為027
2?設(shè)置命令行界面超時退出
? ??編輯/etc/profile,增加 export TMOUT=300(單位:秒),重新登錄時生效
3?禁止root用戶遠(yuǎn)程ssh登錄
? ??修改/etc/ssh/sshd_config文件,配置PermitRootLogin no 重啟sshd服務(wù)生效
4?啟用syslog日志審計
? ?編輯/etc/rsyslog.conf,?配置:?authpriv.* /var/log/secure 并手動創(chuàng)建該文件,重啟rsyslog生效
三、協(xié)議安全
1 禁止FTP匿名用戶登錄
? ??編輯/etc/vsftpd.conf(或/etc/vsftpd/vsftpd.conf)文件,設(shè)置:anonymous_enable=NO
2?禁止root登錄VSFTP
? ??編輯/etc/ftpusers(或/etc/vsftpd/ftpusers)文件,添加root
3 SSH配置非22端口,禁用telnet協(xié)議
四、其他
1?刪除.netrc 文件
? ? 查找,find / -maxdepth 3 -name .netrc 2>/dev/null,重命名或者刪除
2?刪除hosts.equiv文件
? ??find / -maxdepth 3 -name hosts.equiv 2>/dev/null
3?刪除.rhosts 文件
? ??find / -maxdepth 3 -name .rhosts 2>/dev/null
4?關(guān)閉不必要的服務(wù)和端口
? ? chkconfig --list
? ??chkconfig [--level levels] 服務(wù)名 off
5?刪除系統(tǒng)banner信息,避免泄漏操作系統(tǒng)泄漏
刪除或重命名"/etc"目錄下的 issue.net 和 issue 文件:
mv /etc/issue /etc/issue.bak
mv /etc/issue.net /etc/issue.net.bak
6 服務(wù)軟件隱藏版本號等關(guān)鍵信息,并定期升級
Windows遠(yuǎn)程桌面遠(yuǎn)程代碼執(zhí)行漏洞(CVE-2019-0708)https://blog.csdn.net/feng2147685/article/details/90691322