基線整改部分文件

2021-10-22 08:50:43 字數 1493 閱讀 4364

cp -p /etc/group /etc/group_bak

groupadd groupname

usermod -g root luoshen

fdisk -l

方法二:修改 vi /etc/sudoers 檔案,找到下面一行,在root下面新增一行,如下所示:

root all=(all) all

luoshen all=(all) all

vi /etc/issue vi /etc/issue.net vi /etc/motd

authorized users only. all activity may be monitored and reported

vi /etc/hosts.allow

sshd:133.0.7.:allow #允許192.168.0的整個網段訪問ssh服務程序

sshd:192.168.9.:allow #允許192.168.0的整個網段訪問ssh服務程序

vsftpd:10.160.54.:allow

vsftpd:10.162.6.:allow

ftpd_banner=welcome to luoshen ftp service.

vi /etc/hosts.deny

all:all #拒絕一切遠端訪問,但是配合檔案hosts.allow一起使用.當兩者有衝突時,以hosts.allow設定優先。

vi /etc/sysctl.conf

net.ipv4.ip_forward = 0

net.ipv4.conf.all.accept_redirects = 0

sysctl -p

vi /etc/pam.d/system-auth

password requisite pam_cracklib.so retry=3 minlen=8 dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1

auth required pam_tally2.so deny=5 onerr=fail no_magic_root unlock_time=180 #unlock_time單位為秒

account required pam_tally2.so

password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok remember=5

chmod 644 /etc/passwd

chmod 400 /etc/shadow

chmod 644 /etc/group

chmod 644 /etc/services

chmod 600 /etc/xinetd.conf

chmod 600 /etc/security

systemctl start ntpd

systemctl restart sshd

systemctl status chronyd

systemctl start chronyd

ansible基線安全漏洞整改

修復環境 centos7及以上 安全基線的概念 安全基線是乙個資訊系統的最小安全保證,即該資訊系統最基本需要滿足的安全要求。資訊 系統安全往往需要在安全付出成本與所能夠承受的安全風險之間進行平衡,而安全基線正 是這個平衡的合理的分界線。不滿足系統最基本的安全需求,也就無法承受由此帶來的安全 風險,而...

Git轉殖部分檔案

mkdir druid cd druid git init 初始化空倉庫 git remote add f origin 關聯遠端位址 git config core.sparsecheckout true 開啟sparse checkout模式 echo druid doc git info sp...

Git轉殖部分檔案

轉殖部分檔案 轉殖部分檔案 總結一下 乙個完整的例子 在進行專案開發的時候,有時候會有這樣的需求那就是 我們只希望從git倉庫裡取指定的檔案或者資料夾出來。在svn裡面,這非常容易實現,因為svn基於檔案方式儲存,而git卻是基於元資料方式分布式儲存檔案資訊的,它會在每一次clone的時候將所有資訊...