![](/img/trans.png)
[英]Wordpress Visual Composer editor fails in a three level container/components
[英]SSH within Wordpress container fails
我在 Rasperry Pi 上的 docker 容器內運行 Wordpress。 我已經通過管理控制台登錄並安裝了 WPTerm 插件。 啟動 WPTerm 並使用 ssh 和以下 arguments
./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
它不能解決我原來的問題,但現在已經足夠了
服務器看起來像一個基於ssh-streams
package 的 nodejs 模塊。
我查看了 NPM 存儲庫中的幾個模塊,發現它們不支持交互式會話。
它們支持 SFTP 並且可以執行命令,但沒有交互式輸入流。
嘗試ssh <keys> /bin/bash -i
- 它不會分配 pts,但仍可能以或多或少的交互方式接受命令。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.