ssh-action
ssh-action copied to clipboard
Use password and key at same time
My host requires the use of both password and ssh-key to connect, but this action does not allow it returning the following: 20***/08/16 19:04:14 can't set password and key at the same time
Its used as follows:
name: Migration
on:
push:
branches:
- master
jobs:
ssh-migration:
needs: phpunit
runs-on: ubuntu-latest
steps:
- uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASS }}
port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.SSH_KEY }}
script: |
cd ${{ secrets.SSH_BASE_PATH }}/laravel
php artisan migrate
I have the exact same problem. Have been looking for different solutions, but never found one :( Then i came across this project, and hoped it would work, but again with no luck.
Is it going to be supported? It is really annoying that the host requires both, but not much i can do about it
@AlexWestergaard you use simply? ;) Did you find a solution yet?
@zploited for simple hosting solutions I use Simply, yes, but mostly Digital Ocean.
I did not find a fix for this action; ended up making a cronjob that checks migrations and composer updates on the go instead.
ok, I have found another action that could solve it for me:
- for uploading with sftp: wangyucode/sftp-upload-action
- for running ssh commands: garygrossgarten/github-action-ssh
both can use both password and private key, and I just deployed to simply with it
I don't find anything on arygrossgarten/github-action-ssh
Nevermind, spelling error, I found it garygrossgarten/github-action-ssh
woops, yes, I missed the g when copying ;) Good you found out
What you need to do is to create a new ssh-key without password, I did it like this and it worked!
What you need to do is to create a new ssh-key without password, I did it like this and it worked!
That is not really an option when the host/provider requires both.
You need to create an user that does this task (no password).
You need to create an user that does this task (no password).
I am not sure if you are failing to read key words like host
and requires
and that its not optional.
Doesn't your host let you to create Linux users? for example I have two users, the first one is to manage the server and the second one for github actions and without set a password to get into, just ssh-key (with limited permissions).
Doesn't your host let you to create Linux users? for example I have two users, the first one is to manage the server and the second one for github actions and without set a password to get into, just ssh-key (with limited permissions).
Correct, the host is not a VPS and is a single-user predefined username+password. I can add key through dashboard for ssh - but it still requires both username and password on authentication.
Thus, I need it to support all 3 at once.
Yeah, I got it, that's the problem because of appleboy cannot type the password (when the terminal prompt shows up) like a human. I had the same problem, for that reason I decided to create a no password new user.
I will take a look.
try v0.1.8 version
- name: correct password but wrong key
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
key: "1234"
port: ${{ secrets.PORT }}
script: whoami
- name: wrong password but correct key
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: "abcdef"
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: whoami