首先确保ssh服务已经安装:

ps -e | grep ssh

or

service ssh start

如果没有安装则:

apt-get install ssh

安装完之后

查看 /etc/ssh/sshd_config

cat sshd_config
# $OpenBSD: sshd_config,v 1.102 // :: djm Exp $ # This is the sshd server system-wide configuration file. See
# sshd_config() 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
#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 prohibit-password
#StrictModes yes
#MaxAuthTries
#MaxSessions #PubkeyAuthentication yes # 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 # 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
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval
#ClientAliveCountMax
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups ::
#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

目前被注释,且默认为禁止状态 #PermitRootLogin prohibit-password

修改:

PermitRootLogin yes 

然后重启SSH服务:

service sshd restart

OR

/etc/initd.d/sshd restart

重新连接就可以了

最新文章

  1. c#线程带参数
  2. 基于HT for Web矢量实现2D叶轮旋转
  3. 页面内容排序插件jSort的使用
  4. 【第41套测试题NOIP2007】【排序】【DP】【高精度】【树】【图上路径】
  5. JSON-JQuery常用技巧
  6. OpenERP新手易犯错误之res.model
  7. Django Web开发【1】Django简介
  8. 【Linux&Unix--文件描述叙事的性格和权柄】
  9. 无法创建链接服务器 "xxx" 的 OLE DB 访问接口 "OraOLEDB.Oracle" 的实例。 (Microsoft SQL Server,错误: 7302)
  10. Linux中nmon的安装与使用【转】
  11. 201521123013 《Java程序设计》第6周学习总结
  12. javascript 三种弹出对话框
  13. python_代码中调用java类
  14. cestOs 7安装Jenkins
  15. 空类指针为什么可以调用类的成员函数 以及 A(){}和A();
  16. hdu2060-2062
  17. Linux file命令详解
  18. echarts中datazoom相关配置
  19. spring MVC 后台token防重复提交解决方案
  20. Java并发编程(六):Java里实现对象安全发布的四种方式

热门文章

  1. 2、介绍在TensorFlow当中使用不同的方式创建张量tensor
  2. Win下PHP5.6版本安装redis扩展
  3. 微信小程序解析HTML标签带有<p>
  4. layer.open中父页面向子页面传值
  5. 【转】通过python调用jenkins 常用api操作
  6. 猜解数据库(MYSQL)信息
  7. centos7一步一步搭建docker tomcat 及重点讲解
  8. 00-Docker基本安装
  9. docker学习及应用
  10. char **argv 与char *argv[]