VPS侦探论坛

 找回密码
 注册
查看: 6522|回复: 6

sshd_conf修改后无响应的问题

[复制链接]
发表于 2012-6-26 03:39:36 | 显示全部楼层 |阅读模式

根据军哥教程,修改了端口并使用密匙登陆,在0.7-0.8版本中我都是这么做的’为什么0.9版本就无法连接了呢’我用xshell和winscp都不能连接’
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2012-6-26 03:42:19 | 显示全部楼层


是不是密匙登陆在九这个版本不适用?现在有什么办法可以登陆到root里去呢?
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2012-6-26 08:44:13 | 显示全部楼层

lnmp和密钥登录没关系,可能步骤上哪一步出问题了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2012-6-26 11:56:24 | 显示全部楼层



winscp的提示是这样的。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2012-6-26 12:07:46 | 显示全部楼层

相当郁闷,之前一直用的是lnmp0.7的版本,一直没出问题,仔细回想了步骤,也没错。
我的密匙设置是这样的:
ssh-keygen -t rsa
mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys

将sshd_config上传到/etc/ssh,覆盖原来的文件
已经将默认端口22去掉,替换28518为端口
并将RSAAuthentication 和 PubkeyAuthentication  激活为yes
将PasswordAuthentication yes 修改成 PasswordAuthentication no

/etc/init.d/sshd restart

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2012-6-26 12:11:29 | 显示全部楼层

我把sshd_conf配置贴出来:帮我看看是哪里错了?跟Lnmp0.9的一样吗?
  1. #        $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $

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

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

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

  9. port 28357
  10. #Protocol 2,1
  11. Protocol 2
  12. #AddressFamily any
  13. #ListenAddress 0.0.0.0
  14. #ListenAddress ::

  15. # HostKey for protocol version 1
  16. #HostKey /etc/ssh/ssh_host_key
  17. # HostKeys for protocol version 2
  18. #HostKey /etc/ssh/ssh_host_rsa_key
  19. #HostKey /etc/ssh/ssh_host_dsa_key

  20. # Lifetime and size of ephemeral version 1 server key
  21. #KeyRegenerationInterval 1h
  22. #ServerKeyBits 768

  23. # Logging
  24. # obsoletes QuietMode and FascistLogging
  25. #SyslogFacility AUTH
  26. SyslogFacility AUTHPRIV
  27. #LogLevel INFO

  28. # Authentication:

  29. #LoginGraceTime 2m
  30. #PermitRootLogin yes
  31. #StrictModes yes
  32. #MaxAuthTries 6

  33. RSAAuthentication yes
  34. PubkeyAuthentication yes
  35. #AuthorizedKeysFile        .ssh/authorized_keys

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

  45. # To disable tunneled clear text passwords, change to no here!
  46. PasswordAuthentication no
  47. #PermitEmptyPasswords no
  48. #PasswordAuthentication yes

  49. # Change to no to disable s/key passwords
  50. #ChallengeResponseAuthentication yes
  51. ChallengeResponseAuthentication no

  52. # Kerberos options
  53. #KerberosAuthentication no
  54. #KerberosOrLocalPasswd yes
  55. #KerberosTicketCleanup yes
  56. #KerberosGetAFSToken no

  57. # GSSAPI options
  58. #GSSAPIAuthentication no
  59. GSSAPIAuthentication yes
  60. #GSSAPICleanupCredentials yes
  61. GSSAPICleanupCredentials yes

  62. # Set this to 'yes' to enable PAM authentication, account processing,
  63. # and session processing. If this is enabled, PAM authentication will
  64. # be allowed through the ChallengeResponseAuthentication mechanism.
  65. # Depending on your PAM configuration, this may bypass the setting of
  66. # PasswordAuthentication, PermitEmptyPasswords, and
  67. # "PermitRootLogin without-password". If you just want the PAM account and
  68. # session checks to run without PAM authentication, then enable this but set
  69. # ChallengeResponseAuthentication=no
  70. #UsePAM no
  71. UsePAM yes

  72. # Accept locale-related environment variables
  73. AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
  74. AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
  75. AcceptEnv LC_IDENTIFICATION LC_ALL
  76. #AllowTcpForwarding yes
  77. #GatewayPorts no
  78. #X11Forwarding no
  79. X11Forwarding yes
  80. #X11DisplayOffset 10
  81. #X11UseLocalhost yes
  82. #PrintMotd yes
  83. #PrintLastLog yes
  84. #TCPKeepAlive yes
  85. #UseLogin no
  86. #UsePrivilegeSeparation yes
  87. #PermitUserEnvironment no
  88. #Compression delayed
  89. #ClientAliveInterval 0
  90. #ClientAliveCountMax 3
  91. #ShowPatchLevel no
  92. #UseDNS yes
  93. #PidFile /var/run/sshd.pid
  94. #MaxStartups 10
  95. #PermitTunnel no
  96. #ChrootDirectory none

  97. # no default banner path
  98. #Banner /some/path

  99. # override default of no subsystems
  100. Subsystem        sftp        /usr/libexec/openssh/sftp-server
复制代码
 楼主| 发表于 2012-6-26 14:25:57 | 显示全部楼层

搞清楚了,是机房的问题。导致无法远程连接这个端口。现在可以正常连接了。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-17 17:52 , Processed in 0.028355 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表