appleboy / ssh-action

GitHub Actions for executing remote ssh commands.
https://github.com/marketplace/actions/ssh-remote-commands
MIT License
4.84k stars 576 forks source link

ssh: handshake failed: EOF #315

Open c7e715d1b04b17683718fb1e8944cc28 opened 7 months ago

c7e715d1b04b17683718fb1e8944cc28 commented 7 months ago

I am using the master branch, but I cannot SSH because of an error.

appleboy commented 5 months ago

Please provide the following information.

  1. Your hosting provider information, such as DigitalOcean, Linode, AWS, or GCP.
  2. The version information of your host's SSH service.
  3. The information from your host's SSH configuration file.
c7e715d1b04b17683718fb1e8944cc28 commented 5 months ago

1, https://www.shin-server.jp/ 2, OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021 3, I cannot access the SSH configuration file because I do not have root privileges on the server.

Instead, I can give you the SSH connection password.

ryoyamaz commented 2 months ago

Similar problems encountered. In my case, it was due to the SSH settings on the rental server. Due to security enhancements on the rental server side, SSH had been changed to ‘only allow access from within the country’, so I changed it back to ‘allow access from outside the country’ and solved the problem.

menadio commented 1 month ago

Please provide the following information.

  1. Your hosting provider information, such as DigitalOcean, Linode, AWS, or GCP.
  2. The version information of your host's SSH service.
  3. The information from your host's SSH configuration file.

I am currently facing the same issue

Hosting Digitalocean

SSH version OpenSSH_9.6p1 Ubuntu-3ubuntu13.4, OpenSSL 3.0.13 30 Jan 2024

SSH configuration


Include /etc/ssh/ssh_config.d/*.conf

Host *

ForwardAgent no

ForwardX11 no

ForwardX11Trusted yes

PasswordAuthentication yes

HostbasedAuthentication no

GSSAPIAuthentication no

GSSAPIDelegateCredentials no

GSSAPIKeyExchange no

GSSAPITrustDNS no

BatchMode no

CheckHostIP no

AddressFamily any

ConnectTimeout 0

StrictHostKeyChecking ask

IdentityFile ~/.ssh/id_rsa

IdentityFile ~/.ssh/id_dsa

IdentityFile ~/.ssh/id_ecdsa

IdentityFile ~/.ssh/id_ed25519

Port 22

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc

MACs hmac-md5,hmac-sha1,umac-64@openssh.com

EscapeChar ~

Tunnel no

TunnelDevice any:any

PermitLocalCommand no

VisualHostKey no

ProxyCommand ssh -q -W %h:%p gateway.example.com

RekeyLimit 1G 1h

UserKnownHostsFile ~/.ssh/known_hosts.d/%k

SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
CASignatureAlgorithms +ssh-rsa
A bit of context, I am using `ed25519` generated on my local machine and I added the public key to the Digitalocean ubuntu serve `~/.ssh/authorized_keys`. I also added the private key to github secrets and below is my workflow

name: Staging Deployment

run-name: Code deployment to staging by ${{ github.actor }}

on: push: branches:

jobs: staging-deployment: name: Continuous deployment

runs-on: ubuntu-latest

steps:
  - name: Checkout code from repository
    uses: actions/checkout@v3

  - name: Deploy code to server
    uses: appleboy/ssh-action@v1.1.0
    with:
      host: ${{ secrets.HOST }}
      username: ${{ secrets.USERNAME }}
      key: ${{ secrets.SSH_PRIVATE_KEY }}
      port: ${{ secrets.PORT }}
      script: |
        whoami
mxknt commented 3 weeks ago

I'm having the same issue as @menadio, also on a DigitalOcean VM. Scratch that, I had the username set incorrectly, appears to be working now.