ssh调试显示
debug1: Next authentication method: publickey
debug1: Offering public key: /dev/fd/63 RSA SHA256:xxxxxxxxxxxxxxxxxx agent
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: Trying private key: /root/.ssh/id_xmss
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: No more authentication methods to try.
xxxxxxx@xxxxxxxx: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
lost connection
gitlab-ci.yml
stages:
- deploy
before_script:
- echo "ssh-user:$SSH_USER"
- echo "ssh-host:$SSH_HOST"
- echo "ci-pro-dir:$CI_PROJECT_DIR"
- export PATH=/usr/local/bin:$PATH
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- '[[ -f /.dockerenv ]] && echo -e "Host *\\n\\tStrictHostKeyChecking no\\n\\n" > ~/.ssh/config'
使用 ssh 到 scp 文件文件夹,但显示 read_passphrase: can't open /dev/tty: No such device or address
存在“/dev/tty”
不知道如何解决,我应该删除“/dev/tty”并重建它吗?
慕沐林林
凤凰求蛊
PIPIONE