九游平台/ ai开发平台modelarts/ 故障排除/ / vs code连接开发环境失败故障处理/ 报错“host key verification failed.'或者'port forwarding is disabled.”如何解决?
更新时间:2024-08-21 gmt 08:00

报错“host key verification failed.'或者'port forwarding is disabled.”如何解决?-九游平台

问题现象

原因分析

notebook实例重新启动后,公钥发生变化,openssh核对公钥发出警告。

解决方法

  • 在vs code中使用命令方式进行远程连接时,增加参数"-o stricthostkeychecking=no"
    ssh -tt -o stricthostkeychecking=no -i ${identityfile} ${user}@${hostname} -p ${port}

    参数说明:

    - identityfile:本地密钥路径

    - user:用户名,例如:ma-user

    - hostname:ip地址

    - port:端口号

  • 在vs code中手工配置远程连接时,在本地的ssh config文件中增加配置参数“stricthostkeychecking no”和“userknownhostsfile=/dev/null”
    host xxx
        hostname x.x.x.x #ip地址
        port 22522
        user ma-user
        identityfile c:/users/my.pem
        stricthostkeychecking no
        userknownhostsfile=/dev/null
        forwardagent yes

提示:增加参数后ssh登录时会忽略known_hosts文件,有安全风险。

相关文档

网站地图