sshd_config优化

sshd_config优化
linux系统调优,参考百度搜索  linux ssh命令
  /etc/init.d/sshd restart    重启ssh
  193  ls
  194  vim /etc/ssh/sshd_config  编辑ssh配置
GSSAPIAuthentication no   X11Forwarding no    UseDNS no
  195  ls
  196  /etc/init.d/sshd restart    
        yum install openssh-clients    安装SSH
  207  ls
  208  /etc/init.d/sshd restart    
  209  ssh -vv [email protected]    模拟linux重启

# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $

# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
Protocol 2

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024

# Logging
# obsoletes QuietMode and FascistLogging
SyslogFacility AUTH
#SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedKeysCommand none
#AuthorizedKeysCommandRunAs nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don‘t trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don‘t read the user‘s ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
#KerberosUseKuserok yes

# GSSAPI options
GSSAPIAuthentication no
#GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# Set this to ‘yes‘ to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to ‘no‘.
#UsePAM no
UsePAM yes

# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
UseDNS no
#CheckHostIP no

#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none

# no default banner path
#Banner none

# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand cvs server

时间: 2024-10-13 02:31:44

sshd_config优化的相关文章

CentOs7

http://www.sa-log.com/276.html 关于命令和操作系统简单优化的步骤如下: ———————————-大家好,我是分割线,虽然我并不华丽———————————- 网络命令参考 ip  [选项]  操作对象{link|addr|route…} # ip link show                  # 显示网络接口信息 # ip link set eth0 upi          # 开启网卡 # ip link set eth0 down         # 关

系统安全的几点细节

#设定用户90天修改密码,提前7天提醒 UserList=$(ls /home/|awk '{print $NF}'|grep -v lost+found) for user in  $UserList do         chage -M 90 -W 7 $user done #禁ping echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all #设定用户过期时间90默认密码长度8位 cp /etc/login.defs /etc/login.def

Linux中Sshd服务配置文件优化版本(/etc/ssh/sshd_config)

Linux中Sshd服务配置文件优化版本(/etc/ssh/sshd_config) # $OpenBSD: sshd_config,v 1.93 2014/01/10 05:59:19 djm Exp $ # If you want to change the port on a SELinux system, you have to tell # SELinux about this change. # semanage port -a -t ssh_port_t -p tcp #PORTN

虚拟机初装优化

安装完linux系统后调优及安全设置    1.关闭SELINUX功能(这里修改了配置文件.需要重新启动才可以起作用)        # sed -i 's#SELINUX=enforcing#SELINUX=disabled' /etc/selinux/config         # grep 'SELINUX=disabled' /etc/selinux/config         SELINUX=disabled    2.临时关闭selinux        # setenforce

linux生产环境精华优化实战配置(亲测)

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 编写人:陈飞 邮箱:[email protected] +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ CentOS系统安装之后并不能立即投入生产环境使用,往往需要先经过我们运维人员的优化才行.在此讲解几

刚搭建的linux环境的基本优化以及优化脚本---菜鸟初写

本篇博文主要是参考并借鉴老男孩老师的优秀博文外加自己总结及写的优化脚本!博文地址:http://oldboy.blog.51cto.com/2561410/1336488 虽然我并没有参加过老男孩老师的培训但是看过他的优秀视频和优秀博文,接受过他的熏陶与教育,在这里十分感谢老男孩老师!!! 还有这篇博文之中一些操作与脚本的编写非常感谢京峰老师们的帮助! 主要优化的目录 我使用的linux版本是CentOS6.6 x86_64 1.网络配置优化 2.关闭selinux及清除iptables链 3.

CentOS-6.5系统基础优化篇,附带优化脚本

优化内容: (1.设置history历史记录 (2.添加普通用户,设置sudo权限 (3.禁止root远程用户登录 (4.修改远程端口 (5.精简开机启动服务器 (6.关闭selinux (7.配置iptables (8.修改最大连接数 ulimit (9.禁止使用Ctrl+Alt+Del快捷键重启服务器 (10.修改默认DNS (11.安装必要软件,更新yum源 [epel源] (12.更新内核和软件到最新版本 (13.优化内核参数 [根据实际情况调整] (14.去除上次登录的信息 (15.关

老男孩培训视频听课笔记八(在51cto上听的)--5.8 64bit 基础优化

windows user: administrator guest port 3389 Linux user:root 普通用户很多 Port :22 更改ssh登录配置: 位置: /etc/ssh/ssh_config-client 配置 /etc/ssh/sshd_config --服务器端的配置 修改:第一步,备份服务器端的配置   第二步,编辑--说明 #--注释说明 图:   /etc/init.d – yum /rpm 安装的软件全部在这有启动命令 修改后不能登录,用图标来解释如何判

Linux运维二:CentOS6.6系统安装后的基本配置与优化

CentOS6.6系统安装完成后还需要做一些配置与优化: 一:Linux内核版本号介绍 查看内核版本: [[email protected] scripts]# uname -r 2.6.32-504.el6.x86_64 2 表示主版本号,有结构性变化才会更改 6 表示次版本号,新增功能时才变化,一般奇数表示测试版,偶数表示开发版 32 表示对次版本的修订次数或补丁包数 504 代表编译的次数,每次编译可对少数程序优化或修改 el6 用来表示版本的特殊信息,有较大的随意性 e1 代表企业版li