SecureCRT 连接Win10内置ubuntu问题记录

使用SecureCRT 连接Win10内置ubuntu遇到了一些问题, 记录一下.

先通过 ifconfig 查看 ubuntu的ip. 

Q1: 输入hostname, username 后连接提示: ubuntu The remote system refused the connection.

  因为没有安装或启动 ssh.  使用命令 su root 切换至root用户.    使用命令 ps -e | grep ssh 查看是否启动 ssh.

 如没有返回 则尝试使用命令 sudo apt install openssh-server  尝试安装ssh. 

如提示已安装,  使用命令 /etc/init.d/ssh start 启动ssh服务. 再次尝试连接   

//相关命令 停止服务/etc/init.d/ssh stop    重启服务/etc/init.d/ssh restart

Q2: could not load host key. 

 查了下大概是因为鉴证证书的问题  使用命令 ssh-keygen -A  生成key

Q3: a public key file has not been specified for this session would you like to specify one now

在SecureCRT sessions > properties > Connection > SSH2  取消勾选 PublicKey.


Q4: Reason: Unable to authenticate using any of the configured authentication methods.

 修改sshd_config配置信息 vim /etc/ssh/sshd_config  配置项 PasswordAuthentication 值no改为yes  修改后 使用命令 /etc/init.d/ssh restart 重启ssh服务.

附上 vim基本命令.

ESC 退出编辑模式.        :w 保存文件但不退出vi

:w! 强制保存,不退出vi        :wq 保存文件并退出vi 

:wq! 强制保存文件并退出vi        :q 不保存文件 退出vi

:q! 不保存文件 强制退出vi

Q5: The server has disconnected with an error. Server message reads: A protocol error occurred. Change of username or service not allowed: (root,ssh-connection) -> (xxxxxx,ssh-connection)

因为SecureCRT设置的用户名和登录时输入的用户名不一致,在SecureCRT sessions > properties > Connection > SSH2  username 修改一致即可.

到此为止, 终于连接成功了. 学习的过程中有问题要擅于使用搜索引擎.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容