echo"tty1">/etc/securetty
chmod700/root
echo"Passwordsexpireevery180days"
perl-npes/PASS_MAX_DAYSs+99999/PASS_MAX_DAYS180/-i/etc/login.defs
echo"Passwordsmayonlybechangedonceaday"
perl-npes/PASS_MIN_DAYSs+0/PASS_MIN_DAYS1/g-i/etc/login.defs
authconfig--passalgo=sha512--update
perl-npes/umasks+0d2/umask077/g-i/etc/bashrc
perl-npes/umasks+0d2/umask077/g-i/etc/csh.cshrc
touch/var/log/tallylog
cat<<EOF>/etc/pam.d/system-auth
#%PAM-1.0
#Thisfileisauto-generated.
#Userchangeswillbedestroyedthenexttimeauthconfigisrun.
authrequiredpam_env.so
authsufficientpam_unix.sonulloktry_first_pass
authrequisitepam_succeed_if.souid>=500quiet
authrequiredpam_deny.so
authrequiredpam_tally2.sodeny=3onerr=failunlock_time=60
accountrequiredpam_unix.so
accountsufficientpam_succeed_if.souid<500quiet
accountrequiredpam_permit.so
accountrequiredpam_tally2.soper_user
passwordrequisitepam_cracklib.sotry_first_passretry=3minlen=9lcredit=-2ucredit=-2dcredit=-2ocredit=-2
passwordsufficientpam_unix.sosha512shadownulloktry_first_passuse_authtokremember=10
passwordrequiredpam_deny.so
sessionoptionalpam_keyinit.sorevoke
sessionrequiredpam_limits.so
session[success=1default=ignore]pam_succeed_if.soserviceincrondquietuse_uid
sessionrequiredpam_unix.so
EOF
echo"Idleuserswillberemovedafter15minutes"
echo"readonlyTMOUT=900">>/etc/profile.d/os-security.sh
echo"readonlyHISTFILE">>/etc/profile.d/os-security.sh
chmod+x/etc/profile.d/os-security.sh
echo"LockingdownCron"
touch/etc/cron.allow
chmod600/etc/cron.allow
awk-F:{print$1}/etc/passwd|grep-vroot>/etc/cron.deny
echo"LockingdownAT"
touch/etc/at.allow
chmod600/etc/at.allow
awk-F:{print$1}/etc/passwd|grep-vroot>/etc/at.deny
userdelusername
userdeladm
userdellp
userdelsync
userdelshutdown
userdelhalt
userdelnews
userdeluucp
userdeloperator
userdelgames
userdelgopher
groupdelusername
groupdeladm
groupdellp
groupdelnews
groupdeluucp
groupdelgames
groupdeldip
chkconfiglevel35apmdoff
chkconfiglevel35netfsoff
chkconfiglevel35yppasswddoff
chkconfiglevel35ypservoff
chkconfiglevel35dhcpdoff?
chkconfiglevel35portmapoff
chkconfiglevel35lpdoff
chkconfiglevel35nfsoff
chkconfiglevel35sendmailoff
chkconfiglevel35snmpdoff
chkconfiglevel35rstatdoff
chkconfiglevel35atdoff??
chmod-R700/etc/init.d/*
chmoda-s/usr/bin/chage
chmoda-s/usr/bin/gpasswd
chmoda-s/usr/bin/wall
chmoda-s/usr/bin/chfn
chmoda-s/usr/bin/chsh
chmoda-s/usr/bin/newgrp
chmoda-s/usr/bin/write
chmoda-s/usr/sbin/usernetctl
chmoda-s/usr/sbin/traceroute
chmoda-s/bin/mount
chmoda-s/bin/umount
chmoda-s/bin/ping
chmoda-s/sbin/netreport
chmod600/etc/grub.conf
chattr+i/etc/grub.conf
欢迎光临 仓酷云 (http://ckuyun.com/) | Powered by Discuz! X3.2 |