Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ppabc committed Aug 10, 2016
1 parent a3ed7af commit 3d25bf7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
13 changes: 9 additions & 4 deletions ssh/ssh_config.sh → ssh/ssh_config_centos6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@
##centos 6

##SSH持久化socket
cat /home/php/.ssh/config

cat >/home/php/.ssh/config<<EOF
Host *
Compression yes
ServerAliveInterval 60
ServerAliveCountMax 5
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 4h

EOF

cat /home/php/.ssh/config


##SSH配置优化
cat /etc/ssh/sshd_config
cat >/etc/ssh/sshd_config<<EOF
Port 22
AddressFamily inet
ListenAddress 0.0.0.0
Expand All @@ -35,6 +37,9 @@ UsePAM yes
UseDNS no
X11Forwarding yes
Subsystem sftp /usr/libexec/openssh/sftp-server
EOF

cat /etc/ssh/sshd_config


##SSH禁止IPv6,只要ipv4
Expand Down
5 changes: 4 additions & 1 deletion ssh/ssh_config_centos7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


##SSH配置优化
cat /etc/ssh/sshd_config
cat >/etc/ssh/sshd_config<<EOF
Port 22
AddressFamily inet
ListenAddress 0.0.0.0
Expand All @@ -32,6 +32,9 @@ AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
Subsystem sftp /usr/libexec/openssh/sftp-server
EOF

cat /etc/ssh/sshd_config


##SSH禁止IPv6,只要ipv4
Expand Down

0 comments on commit 3d25bf7

Please sign in to comment.