openresty / openresty/lua-resty-shell
exec ssh cmd can't open /dev/tty
Nobody has claimed this yet.
- Dominant language
- Raku
- Stars
- 133
- Forks
- 19
- Avg merge
- 2h 31m
- Merged PRs (30d)
- 1
Description
my lua code:
local ok, stdout, stderr, reason, status=shell.run([[ls -la /dev/tty && ssh -v ecs@10.242.19.149 'pwd']])
stdout:
crw-rw-rw- 1 root root 5, 0 Jan 26 10:03 /dev/tty
stderr:
OpenSSH_7.6p1 Ubuntu-4ubuntu0.4, OpenSSL 1.0.2n 7 Dec 2017\13\
debug1: Reading configuration data /etc/ssh/ssh_config\13\
debug1: Connecting to 10.242.19.149 [10.242.19.149] port 22.\13\
debug1: Connection established.\13\
debug1: permanently_set_uid: 0/0\13\
debug1: identity file /root/.ssh/id_rsa type 0\13\
debug1: key_load_public: No such file or directory\13\
debug1: identity file /root/.ssh/id_rsa-cert type -1\13\
debug1: key_load_public: No such file or directory\13\
debug1: identity file /root/.ssh/id_dsa type -1\13\
debug1: key_load_public: No such file or directory\13\
debug1: identity file /root/.ssh/id_dsa-cert type -1\13\
debug1: key_load_public: No such file or directory\13\
debug1: identity file /root/.ssh/id_ecdsa type -1\13\
debug1: key_load_public: No such file or directory\13\
debug1: identity file /root/.ssh/id_ecdsa-cert type -1\13\
debug1: key_load_public: No such file or directory\13\
debug1: identity file /root/.ssh/id_ed25519 type -1\13\
debug1: key_load_public: No such file or directory\13\
debug1: identity file /root/.ssh/id_ed25519-cert type -1\13\
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.4\13\
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.3\13\
debug1: match: OpenSSH_8.3 pat OpenSSH* compat 0x04000000\13\
debug1: Authenticating to 10.242.19.149:22 as 'ecs'\13\
debug1: SSH2_MSG_KEXINIT sent\13\
debug1: SSH2_MSG_KEXINIT received\13\
debug1: kex: algorithm: curve25519-sha256\13\
debug1: kex: host key algorithm: ecdsa-sha2-nistp256\13\
debug1: kex: server->client cipher: aes128-ctr MAC: umac-64-etm@openssh.com compression: none\13\
debug1: kex: client->server cipher: aes128-ctr MAC: umac-64-etm@openssh.com compression: none\13\
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY\13\
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:Q9Mt2lHfjuOyBtpwR5nJAF62bntiFA9L4bIln4WS570\13\
debug1: Host '10.242.19.149' is known and matches the ECDSA host key.\13\
debug1: Found key in /root/.ssh/known_hosts:4\13\
debug1: rekey after 4294967296 blocks\13\
debug1: SSH2_MSG_NEWKEYS sent\13\
debug1: expecting SSH2_MSG_NEWKEYS\13\
debug1: SSH2_MSG_NEWKEYS received\13\
debug1: rekey after 4294967296 blocks\13\
debug1: SSH2_MSG_EXT_INFO received\13\
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>\13\
debug1: SSH2_MSG_SERVICE_ACCEPT received\13\
Authorized only. All activity will be monitored and reported \
debug1: Authentications that can continue: publickey,password\13\
debug1: Next authentication method: publickey\13\
debug1: Offering public key: RSA SHA256:bHTPC4YQ1nZ/BgIHH3g/ndanAPWvvRD9WyDmUD9buxM /root/.ssh/id_rsa\13\
debug1: Authentications that can continue: publickey,password\13\
debug1: Trying private key: /root/.ssh/id_dsa\13\
debug1: Trying private key: /root/.ssh/id_ecdsa\13\
debug1: Trying private key: /root/.ssh/id_ed25519\13\
debug1: Next authentication method: password\13\
debug1: read_passphrase: can't open /dev/tty: No such device or address\13\
debug1: Authentications that can continue: publickey,password\13\
Permission denied, please try again.\13\
debug1: read_passphrase: can't open /dev/tty: No such device or address\13\
debug1: Authentications that can continue: publickey,password\13\
Permission denied, please try again.\13\
debug1: read_passphrase: can't open /dev/tty: No such device or address\13\
debug1: Authentications that can continue: publickey,password\13\
debug1: No more authentication methods to try.\13\
ecs@10.242.19.149: Permission denied (publickey,password).\13\
/dev/tty is exist but ssh can't open
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported shell.run invocation and its OpenSSH diagnostic output; the payload names no repository files or tests. Reproduce the noninteractive SSH case, determine whether the behavior belongs to lua-resty-shell or SSH password prompting, and establish the expected behavior before defining a regression check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100