蓝色动力网络

 找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 2209|回复: 0

网众无盘5.8服务器启用 ssh的方法

[复制链接]
发表于 2012-4-3 08:09:50 | 显示全部楼层 |阅读模式
我使用的网众5.8服务端是Linux版的,因为我认为linux平台安全性高,效率高,稳定性好;同样一台服务器,linux平台的会windows平台的多带一些机器;同样windows平台的不容易出现问题。
网上的很多朋友都喜欢使用Vnc远程web的方式管理服务器,但是有些时候我还是喜欢通过ssh管理服务器,安全,方便,通过ssh我们还可以向服务器传输数据。但是默认情况下网众5.8服务端是没有启用ssh的,在/etc/init.d/下面没有sshd的执行脚本,/etc下面没有sshd的rsa密钥对(公钥+私钥),我们是无法启动sshd的。
1.我们使用ssh_keygen -t rsa 生成rsa密钥对,默认保存在/root/.ssh/下面
id_rsa(私钥)       id_rsa.pub(公钥)
2.把密钥拷贝到 /etc/ssh下面
cat id_rsa>/etc/ssh/ssh_host_dsa_key          私钥重定向
cat id_rsa.pub /etc/ssh/ssh_host_dsa_key.pub       公钥重定向
3.修改 /etc/ssh/sshd_config,去掉某些 “#” 表示启用
  1. 1#       $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $
  2. 2
  3. 3  # This is the sshd server system-wide configuration file.  See
  4. 4  # sshd_config(5) for more information.
  5. 5
  6. 6  # This sshd was compiled with PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
  7. 7
  8. 8  # The strategy used for options in the default sshd_config shipped with
  9. 9  # OpenSSH is to specify options with their default value where
  10. 10  # possible, but leave them commented.  Uncommented options change a
  11. 11  # default value.
  12. 12
  13. 13  Port 22
  14. 14  #AddressFamily any
  15. 15  ListenAddress 0.0.0.0
  16. 16  #ListenAddress ::
  17. 17
  18. 18  # Disable legacy (protocol version 1) support in the server for new
  19. 19  # installations. In future the default will change to require explicit
  20. 20  # activation of protocol 1
  21. 21  Protocol 2
  22. 22
  23. 23  # HostKey for protocol version 1
  24. 24  HostKey /etc/ssh/ssh_host_key
  25. 25  # HostKeys for protocol version 2
  26. 26  #HostKey /etc/ssh/ssh_host_rsa_key
  27. 27  HostKey /etc/ssh/ssh_host_dsa_key
  28. 28
  29. 29  # Lifetime and size of ephemeral version 1 server key
  30. 30  #KeyRegenerationInterval 1h
  31. 31  #ServerKeyBits 1024
  32. 32
  33. 33  # Logging
  34. 34  # obsoletes QuietMode and FascistLogging
  35. 35  #SyslogFacility AUTH
  36. 36  #LogLevel INFO
  37. 37
  38. 38  # Authentication:
  39. 39
  40. 40  LoginGraceTime 2m
  41. 41  PermitRootLogin yes
  42. 42  StrictModes yes
  43. 43  MaxAuthTries 6
  44. 44  MaxSessions 10
  45. 45
  46. 46  RSAAuthentication yes
  47. 47  PubkeyAuthentication yes
  48. 48  AuthorizedKeysFile      .ssh/authorized_keys
  49. 49
  50. 50  # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
  51. 51  #RhostsRSAAuthentication no
  52. 52  # similar for protocol version 2
  53. 53  #HostbasedAuthentication no
  54. 54  # Change to yes if you don’t trust ~/.ssh/known_hosts for
  55. 55  # RhostsRSAAuthentication and HostbasedAuthentication
  56. 56  #IgnoreUserKnownHosts no
  57. 57  # Don’t read the user’s ~/.rhosts and ~/.shosts files
  58. 58  #IgnoreRhosts yes
  59. 59
  60. 60  # To disable tunneled clear text passwords, change to no here!
  61. 61  #PasswordAuthentication yes
  62. 62  #PermitEmptyPasswords no
  63. 63
  64. 64  # Change to no to disable s/key passwords
  65. 65  #ChallengeResponseAuthentication yes
  66. 66
  67. 67  # Kerberos options
  68. 68  #KerberosAuthentication no
  69. 69  #KerberosOrLocalPasswd yes
  70. 70  #KerberosTicketCleanup yes
  71. 71  #KerberosGetAFSToken no
  72. 72
  73. 73  # GSSAPI options
  74. 74  #GSSAPIAuthentication no
  75. 75  #GSSAPICleanupCredentials yes
  76. 76
  77. 77  # Set this to ‘yes’ to enable PAM authentication, account processing,
  78. 78  # and session processing. If this is enabled, PAM authentication will
  79. 79  # be allowed through the ChallengeResponseAuthentication and
  80. 80  # PasswordAuthentication.  Depending on your PAM configuration,
  81. 81  # PAM authentication via ChallengeResponseAuthentication may bypass
  82. 82  # the setting of “PermitRootLogin without-password”.
  83. 83  # If you just want the PAM account and session checks to run without
  84. 84  # PAM authentication, then enable this but set PasswordAuthentication
  85. 85  # and ChallengeResponseAuthentication to ‘no’.
  86. 86  #UsePAM no
  87. 87
  88. 88  #AllowAgentForwarding yes
  89. 89  #AllowTcpForwarding yes
  90. 90  #GatewayPorts no
  91. 91  #X11Forwarding no
  92. 92  #X11DisplayOffset 10
  93. 93  #X11UseLocalhost yes
  94. 94  #PrintMotd yes
  95. 95  #PrintLastLog yes
  96. 96  #TCPKeepAlive yes
  97. 97  #UseLogin no
  98. 98  #UsePrivilegeSeparation yes
  99. 99  #PermitUserEnvironment no
  100. 100  #Compression delayed
  101. 101  #ClientAliveInterval 0
  102. 102  #ClientAliveCountMax 3
  103. 103  #UseDNS yes
  104. 104  #PidFile /var/run/sshd.pid
  105. 105  #MaxStartups 10
  106. 106  #PermitTunnel no
  107. 107  #ChrootDirectory none
  108. 108
  109. 109  # no default banner path
  110. 110  #Banner none
  111. 111
  112. 112  # override default of no subsystems
  113. 113  Subsystem       sftp    /usr/libexec/sftp-server
  114. 114
  115. 115  # Example of overriding settings on a per-user basis
  116. 116  #Match User anoncvs
  117. 117  #       X11Forwarding no
  118. 118  #       AllowTcpForwarding no
  119. 119  #       ForceCommand cvs server
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

蓝色动力网络微信平台
网站管理,业务合作联系邮箱: admin#lansedongli.com    QQ:13412492 限网站业务问题.
网站帐号、密码、密保找回请使用注册邮箱,发送邮件至 password#lansedongli.com ,否则不予受理.
免责声明:本论坛所有文字和图片仅代表其个人观点.
本站某些资料或文章来自于互联网,不代表本站观点,如果侵犯了您的权益,请来信告知,我们会在三天内删除.
为了给大家一个更好的交流场所,请勿在本论坛发表与中华人民共和国法律相抵触的言论,请合作,谢谢!
Copyright © 2007-2019 Corporation Powered by网吧系统 版权所有    转载请注明!
浙ICP备11043737号-1 程序:Discuz! x3.4

湘公网安备 43018102000145号

手机版|Archiver|蓝色动力网络   

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