-
-
Notifications
You must be signed in to change notification settings - Fork 545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passhprase not working #65
Comments
If I may ask what's the |
@mojo706 I have set up a password for my ssh key like this: #16 (comment) The feature seems to be implemented but it doesn't work for me. Or did I understand it wrong? I thought using passphrase it would enter the password when trying to pull. I don't have my private key in the repo secrets. Is that the issue? It can't use the key directly from the server? |
@shnigi The private key is in your personal computer under |
@mojo706 Yes I know. But isn't the difference between: password and passphrase the following: password is used to login the server. Can be any user/password. Passphrase is used to pull from Github, again can be any key? So two different passwords. I have ssh login password and Github key password which needs to be entered. I also tried adding my key to Github secrets but it doesn't work. |
@shnigi That's not it. You use the |
There is the modification if you need your SSH Key to log in to your server: - name: Push to server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_IP }}
port: ${{ secrets.PORT }}
username: ${{ secrets.SERVER_USERNAME }}
- password: ${{ secrets.SERVER_PASSWORD }}
+ key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSHKEYPASSWORD }}
script: cd ${{ secrets.PROJECT_PATH }} && git pull Now that you are inside your server, you need credentials to pull from github, if you use HTTPS with username/password try: git pull "https://<username>:<password>@github.com/<github_account>/<repository_name>.git" <branch_name> Complete example, not sure if it's a good practice and I didn't test it : - name: Push to server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_IP }}
port: ${{ secrets.PORT }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSHKEYPASSWORD }}
script: |
cd ${{ secrets.PROJECT_PATH }}
git pull "https://${{ secrets.GITHUB_USERNAME }}:${{ secrets.GITHUB_PASSWORD }}@github.com/shnigi/my_repo.git" master |
I have the same issue, passphrase not working. Relevant part from
I think |
What I am actually doing is that I ssh into my server with name and password, then in the server I have github ssh key which is used to pull the code. I can get this to work if I remove my ssh key password from the server. So appleboy script works to the point where I login to the server but fails when it tries to pull from Github as my sshkey is asking for the password. Then I get the usual error message to github actions center: err: git@github.com: Permission denied (publickey). |
Hello,
@shnigi did you come up with a solution ? I would love to know. |
I've had the same problem. Generate new key and leave "passphrase" empty. |
that's really great tips, thx |
- Add a new job for git clone and pull in CI - Clone a private repository in CI with secrets - Remove a directory in the cloned repository ref: #65
- name: clone private repository
uses: appleboy/ssh-action@v1.1.10
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script_stop: true
script: |
git clone https://appleboy:${{ secrets.TEST_TOKEN }}@github.com/go-training/self-runner.git test_repository
rm -rf test_repository create your personal token from user setting and store value in secret page. |
I tried to add passphrase option as mentioned in this ticket: #16
But it is not working for unknown reason. Here is my yml.
I have secrets added in the repository. I can manually ssh login to my server and do git pull. Then I enter password and it works like it should. However github actions say:
So what am I doing wrong here? I expected that passphrase would input the password for my ssh key. Or is there something else wrong? I also did this: cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
I later removed my ssh key passphrase and then it works! But I really would like to secure my key with password. Looks like the passphrase is not working for some reason?
The text was updated successfully, but these errors were encountered: