linux
root@SA-ubuntu-server:~# cat /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
theuser ALL=(ALL:ALL) NOPASSWD:ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
idealsa@SA-ubuntu-server:~$ id theuser uid=1000(theuser) gid=1000(theuser) groups=1000(theuser),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lpadmin),111(sambashare)
tcp连接优化
cat /etc/sysctl.conf
net.nf_conntrack_max = 655360 net.netfilter.nf_conntrack_tcp_timeout_established = 432000 net.ipv4.tcp_tw_reuse=1 net.ipv4.tcp_tw_recycle=0 net.ipv4.tcp_fin_timeout=30 vm.overcommit_memory = 1
sysctl -p
备注:
tcp_tw_reuse置为1,可以使连接复用
tcp_tw_recycle置为1,可以加速回收
vi /etc/security/limits.conf
* soft nproc 65535 * hard nproc 65535 root soft nofile 65535 root hard nofile 65535
备注:ubuntu系统如果是优化root用户的文件打开数量,一定要写root, 而不能使用 ‘*’ (星号), 否则会发现ulimit -a没有生效

浙公网安备 33010602011771号