Open Roman-Dev00 opened 1 month ago
Can you help to try the v1.0.3 version?
Please provide the ssh server version and /etc/sshd/sshd_config
config file. What is your VM host like DigitalOcean or Linode?
@Roman-Dev00
Please provide the following information:
Hi, @appleboy Thanks for your asking but I don't understand these information. Currently, I am using GitHub to deploy and cpanel to manage the server. And I don't have sshd_config file in etc folder.
@Roman-Dev00 have you try this?
@Roman-Dev00 Where is the Cpanel? Can you provide more detailed information? I need the information to reproduce the issue.
I manage the ssh key in the cpanel like above.
This one is deploying error.
This one is work flow file.
All of these are the detailed information what I can provide.
@Roman-Dev00 I need the information about what is your CPanel Provider. I want to register a new account and reproduce the problem.
we used a managed VPS at namecheap. loyaltycardgenerator.com/cpanel
@Roman-Dev00
What is your solution?
I didn't find the solution yet.
I found new error.
Every version doesn't work now.
@Roman-Dev00 Try appleboy/ssh-action@v1.0.3
version
Hi, @appleboy Hope you are doing well today. v1.0.3 also doesn't work. Currently new error has been occurred. error -> above image What is the reason?
@Roman-Dev00 you missing typo v
appleboy/ssh-action@v0.1.4
thanks. I fixed it, but the initial error still remains.
If you want, you can access my computer using Anydesk and fix my problems.
I've also had issues with methods [none], my server version is Ubuntu22.04, so I added a "/etc/ssh/sshd_config.d/enable_rsa_keys.conf" file as per the docs and it worked fine
https://github.com/appleboy/ssh-action?tab=readme-ov-file#if-you-are-using-openssh
Hello Guys. I have encountered the same problem. I was up all night debugging. I suspect a lot of aspects like that firmware or cnetos7 are too old? or ssh server config or the repository code has a bug but those don't cause the problem. As the sun rises, I think I found the bug position and found the solution, but I don't know why have the problem.
I will be your fan if you tell me the reason.
It's a problem that beginners don't know why, but veterans don't encounter. 老手遇不到,新手不知道原因
You must add your secrets in the Repository Secrets of the Github Setting page(look at the picture). Don't create secrets with GitHub ACTION Plugin at the vscode.
You must copy the complete key like below:
-----BEGIN OPENSSH PRIVATE KEY-----
sdfasdfasdfasa
-----END OPENSSH PRIVATE KEY-----
Include the BEGIN and END lines.
Use secrets auto complement with the GitHub Action Plugin at the Vscode. Don't manually input the Secrets name.
My ssh config is default basically.
# $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
# If you want to change the port on a SELinux system, you have to tell
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
# Ciphers and keying
#RekeyLimit default none
# Logging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
LogLevel INFO
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#PubkeyAuthentication yes
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedPrincipalsFile none
#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
#KerberosUseKuserok yes
# GSSAPI options
GSSAPIAuthentication yes
GSSAPICleanupCredentials no
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no
#GSSAPIEnablek5users no
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
# WARNING: 'UsePAM no' is not supported in Red Hat Enterprise Linux and may cause several
# problems.
UsePAM yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation sandbox
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none
# no default banner path
#Banner none
# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server
name: remote ssh command
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_KEY }}
port: ${{ secrets.SERVER_PORT }}
script: whoami
2024/06/11 22:45:38 ssh.ParsePrivateKey: ssh: no key found
======CMD======
whoami
======END======
2024/06/11 22:45:38 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain
I use ed25519 encropty.
Take your key. The key format is that
-----BEGIN OPENSSH PRIVATE KEY-----
jlakjsdf;lkajsdf;lkajsd;fkja;df
asdflkjas;dkf;askjdf;aksjdf;
-----END OPENSSH PRIVATE KEY-----
You need copy all include BEGIN and END.
Update your private key using Github Action Plugin at Vsocde.
Go to your GitHub repository on the web and manually run the workflow .
You will get the error
Now upate the key with the same vlue on the web
It's work!
2024/06/11 23:44:06 ssh.ParsePrivateKey: ssh: no key found
======CMD======
whoami
======END======
Maybe you don't set your Secrets not below the Repository Secrets or you copy you key but don't completion.
What doesn't matter, and you just need to copy your comple key set the Secrets on right positon on the web, you will not encounter the problem.
Hello, @Cabalist , @appleboy. Hello, everyone Sorry about reposting the same issue like as 80. I have read your solutions carefully and tried to follow all of your suggestions such as
But I still have [none publickey] error. Please help me. Thanks. Here is my mail.yml file.
name: Laravel CI/CD
on: push: branches:
jobs: setup: runs-on: ubuntu-latest
steps:
name: Checkout Repository uses: actions/checkout@v2
name: Set up PHP uses: shivammathur/setup-php@v2 with: php-version: "8.1" deploy: runs-on: ubuntu-latest needs: setup steps:
name: Deploy to FTP uses: SamKirkland/FTP-Deploy-Action@v4.3.4 with: server: ${{ secrets.FTP_SERVER }} username: ${{ secrets.FTP_USERNAME }} password: ${{ secrets.FTP_PASSWORD }} local-dir: ./ # Change this to the path of your Laravel app server-dir: / # Change this to the remote directory on your FTP server
name: SSH into Server and Run Migration uses: appleboy/ssh-action@v0.1.4 with: host: ${{ secrets.SSH_HOST }} username: ${{ secrets.SSH_USERNAME}} key: ${{ secrets.SSH_PRIVATE_KEY }} port: ${{ secrets.SSH_PORT }} passphrase: ${{ secrets.SSH_PASSPHRASE }} script: | cd /home/lcgen/public_html/backend php artisan migrate --force php artisan config:cache php artisan cache:clear php artisan config:clear php artisan route:clear php artisan view:clear I already confirmed the public key in the authorizedkeys. It is same with public key which authorized key in my cpanel. I also have a SSH_PASSWORD variable in github secrets. Should I add this one in the yml like "password: ${{ SSH_PASSWORD }}" even though I set the .ssh permission with 700? And also what can be wrong in my current status? I am not sure why this error has been occurred?