gpt4 book ai didi

php - Wordpress 容器内的 SSH 失败

转载 作者:行者123 更新时间:2023-12-02 13:47:01 26 4
gpt4 key购买 nike

我在 Rasperry Pi 上的 docker 容器内运行 Wordpress。我已经通过管理控制台登录并安装了 WPTerm 插件。启动 WPTerm 并使用带有以下参数的 ssh 时

./ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null -v -T -i ./id_rsa root@172.10.10.2

我得到了错误

debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connection established.
debug1: identity file ./id_rsa type 0
debug1: identity file ./id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.3
debug1: Remote protocol version 2.0, remote software version ssh2js0.0.23srv
debug1: no match: ssh2js0.0.23srv
...
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: diffie-hellman-group1-sha1
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
...
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 4294967296 blocks
...
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentication succeeded (none).
Authenticated to 172.10.10.2 ([172.10.10.2]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
shell request failed on channel 0

我尝试了 WPTerm exec、shell_exec、system、passthru 和 popen 的不同设置,但它们都抛出相同的错误。

如何让 ssh 客户端打开 shell?

最佳答案

我通过使用到本地主机的反向 ssh 隧道找到了解决我的问题的方法

 ./ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null -v -i ./id_rsa root@172.10.10.2 -R 22:172.10.10.2:22 -fN root@192.168.1.107

它并没有解决我最初遇到的问题,但现在已经足够了

关于php - Wordpress 容器内的 SSH 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62297163/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com