SecureCRT 连接Win10内置ubuntu问题及解决办法
1: 输入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
2: could not load host key.
查了下大概是因为鉴证证书的问题 使用命令 ssh-keygen -A 生成key
3: a public key file has not been specified for this session would you like to specify one now
在SecureCRT sessions > properties > Connection > SSH2 取消勾选 PublicKey.

4: 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
5: 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 修改一致即可.
到此为止, 终于连接成功了. 学习的过程中有问题要擅于使用搜索引擎. windows10 内置的ubuntu问题太多,已放弃, 改用redhat7.6
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?