Optimize content:
(1. Set history history
(2. Add ordinary users, set sudo permissions
(3. Prevent root remote user from logging in
(4. Modify Remote port
(5. Streamlined boot server
(6. Close SELinux
(7. Configure Iptables
(8. Modify the maximum number of connections Ulimit
(9. Disable the use of the Ctrl+alt+del shortcut key to restart the server
(10. Modify default DNS
(11. Install necessary software, update yum source [Epel Source]
(12. Update the kernel and software to the latest version
(13. Optimize kernel parameters [adjusted according to actual situation]
(14. Remove last logged in information
(15. Turn off the boot display kernel information
1. Set History history
| Echo ' Export histfile= $HOME/.bash_history export histfilesize= histsize= export histtimeformat= '%F%T ' WhoAmI ' "Export prompt_command=" HISTORY-A; History-c; History-r, "Shopt-s histappend typeset-r prompt_command typeset-r histtimeformat ' >/etc/profile.d/history.sh sour Ce/etc/profile |
2. Add ordinary users, set sudo permissions
| Username= ' Dyt ' password= ' dyt2015 ' useradd $username; echo $password | passwd--stdin $username sed-i "A$username all= (All) Nopasswd:all"/etc/sudoers |
3. Prevent root remote user from logging in