文章目录

  • 步骤1. 修改sshd_config文件
  • 步骤2. 重启服务

步骤1. 修改sshd_config文件

修改文件/etc/ssh/sshd_config为如下内如:

尤其注意需要将UsePAM yes注释为# UsePAM yes样式。

#    $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 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/bin:/bin:/usr/sbin:/sbin# 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 override the
# default value.Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key# Ciphers and keying
#RekeyLimit default none# Logging
#SyslogFacility AUTH
#LogLevel INFO# Authentication:#LoginGraceTime 2m
PermitRootLogin yes
#PermitRootLogin without-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10PubkeyAuthentication no# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2#AuthorizedPrincipalsFile none#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# 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
PermitEmptyPasswords yes# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no# GSSAPI options
#GSSAPIAuthentication no
#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 yes#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none# no default banner path
#Banner none# Allow client to pass locale environment variables
AcceptEnv LANG LC_*# override default of no subsystems
Subsystem   sftp    /usr/lib/openssh/sftp-server# Example of overriding settings on a per-user basis
#Match User anoncvs
#   X11Forwarding no
#   AllowTcpForwarding no
#   PermitTTY no
#   ForceCommand cvs server

步骤2. 重启服务

然后重启服务:service sshd restart

【Linux】ssh登录出现Access denied password问题相关推荐

  1. MTPuTTY连接Ubuntu\Linux SSH登陆出现Access Denied错误

    目录 一.异常错误 二.原因 三.解决方法 1.进入root用户 2.进入/etc/ssh/目录 3.添加PermitRootLogin yes 4.重启SSH 5.SSH重新连接Ubuntu 一.异 ...

  2. linux文件access denied,Linxu系统使用SSH报错Access Denied怎么办?

    一些Linux用户在登录SSH的时候,出现了Access Denied错误,面对这个问题,Linux用户们该如何进行解决呢?现在就让小编来给大家介绍一个解决的方法吧,有需要的用户快来看看吧. 解决方法 ...

  3. Linux连接mysql 出现Access denied for user ‘root‘@‘localhost‘(using password: YES)错误解决方案

    Linux连接mysql 出现Access denied for user 'root'@'localhost'(using password: YES)错误解决方案 参考文章: (1)Linux连接 ...

  4. Linux SSH登录被拒绝:Server refused our key

    使用SSH公钥远程登录服务器,出现Server refused our key;同时,输入正确的用户名及密码出现Access Denied 本地登录服务器,查看auth.log:使用命令:tail - ...

  5. denied 登陆后access_Linxu SSH登陆出现Access Denied错误的解决方法

    其实这个问题是从 SCP 过来的.用 SCP 在两台 Linux 服务器之间传送备份文件.输入完 root 密码后,总是出现 Permission denied, please try again. ...

  6. Linux ssh登录命令

    一.什么是SSH? 简单说,SSH是一种网络协议,用于计算机之间的加密登录. 如果一个用户从本地计算机,使用SSH协议登录另一台远程计算机,我们就可以认为,这种登录是安全的,即使被中途截获,密码也不会 ...

  7. denied 登陆后access_Linux SSH登陆出现Access Denied错误的解决方法

    其实这个问题是从 SCP 过来的.用 SCP 在两台 Linux 服务器之间传送备份文件.输入完 root 密码后,总是出现 Permission denied, please try again. ...

  8. Linxu SSH登陆出现Access Denied错误的解决方法

    其实这个问题是从 SCP 过来的.用 SCP 在两台 Linux 服务器之间传送备份文件.输入完 root 密码后,总是出现 Permission denied, please try again. ...

  9. linux ssh别的机器,Linux SSH 登录其他机器

    ssh命令用于远程登录上Linux主机. 常用格式:ssh [-l login_name] [-p port] [user@]hostname 更详细的可以用ssh -h查看. 举例 不指定用户: s ...

最新文章

  1. RDKit | 从ChEMBL数据库提取大分子HELM单体(XML转换为DataFrame并搜索部分结构)
  2. Displaying Bitmaps Efficiently (一)-----Loading Large Bitmaps Efficiently(二)
  3. OpenCV:详解掩膜mask
  4. 分裂的奶牛群(洛谷P2907题题解,Java语言描述)
  5. Oracle 数据库监听配置
  6. 【待解决】使用JUnit时报错java.lang
  7. Koa 2 基础(仿知乎)
  8. vue - rimraf
  9. To程序员:要写出好代码,你需要懂点儿“底层思维”
  10. ubuntu下MySQL无法启动Couldn't find MySQL server (/usr/bin/mysqld_safe)”
  11. Java自动化测试——打开浏览器
  12. BZOJ1597 [Usaco2008 Mar]土地购买
  13. Android下WPS打开Excel2007版也有问题
  14. 协方差矩阵的定义性质与python实现
  15. UIPinchGestureRecognizer 放大、缩小手势
  16. 如何制作一个微信小程序【微信小程序是怎么做的】
  17. 《邱岳的产品实战》学习笔记:第9周
  18. 通达信 c java,通达信的c
  19. python pymysql cursors_怎么Pythonpymysql.cursors从mysql存储过程获取INOUT返回结果
  20. 【2309. 兼具大小写的最好英文字母】

热门文章

  1. flash下雨效果(附源码)
  2. MAC 以太网(PAUSE)流量控制原理
  3. 亲爱的,我怀了别人的孩子
  4. M201: MongoDB Performance Final Exam学习记录
  5. 酒店管理web项目总结
  6. Deconv的python实现
  7. java将货币转换为大写形式
  8. 直播系统的开发准备工作
  9. Kail linux 学习网站
  10. “二叉树遍历“详解 以及 二叉树的实现