0

I am struggling with connection to my server via SSH through Codeship. I followed their docs but I cannot get it work.

So far I have completed all the steps to make it work but still no luck with it.

Codeship Project SSH public key - Added to my server's authorized_keys file

https://documentation.codeship.com/general/projects/project-ssh-key/

Authenticating Via SSH Public Keys - changed the permissions for the ssh folder with chmod -R go-rwx ~/.ssh/

https://documentation.codeship.com/basic/continuous-deployment/deployment-with-ftp-sftp-scp/#authenticating-via-ssh-public-keys

Also I find out that other guys had the some problem:

https://community.codeship.com/t/what-is-password-for-ssh-access/995/6

... which btw I followed but still with no luck. I've run:

cat ~/.ssh/id_rsa.pub  

... to get my server public key and added it to my Personal Account Settings in Codeship.

Finally I added this test command to my Custom Script in the project's Deploy section.

ssh user@domain.com 'mkdir test_folder'

So after I made some build with git push this is what I get i.e. the script is prompted with password enter:

Warning: Permanently added 'domain.com,XXX.XXX.XXX.XXX' (RSA) to the list of known hosts.
user@domain.com's password:

Any idea what could be the problem, or what am I missing?

Thanks!

Ivica
  • 29
  • 2
  • You're more likely to get help if you show us how you've set things up, rather than just claiming you followed the steps described in some tutorial. – Kenster Apr 12 '18 at 13:41
  • @Kenster what else you want me to provide? So far I've: - connected my repo to the Codeship project - managed to use the lftp command to update the project when git push ( a build ) is running. - lftp takes too much time because it takes all changes and copies all files one by one ( one build can take up to 30mins ) - decided to go with ssh to log into my server and CD to my directory to run git pull - cannot do that because the script is prompted with passowrd ( I already posted the script code above where I try to connect via SSH – Ivica Apr 12 '18 at 13:45
  • Ahoy @Ivica, just to summarize, you added the projects public SSH Key (from the projects _General_ settings page) to the `~/.ssh/authorized_keys` file your server. But you can't connect from an automated build, or a debug VM for that matter? Are you able to connect via SSH from your local machine? And did you run a ssh command in (very) verbose mode via `ssh -vvv ...` This will spit out a lot of log output, but also include pointers on why the key is not accepted. – mlocher Apr 14 '18 at 06:24
  • 1
    @mlocher Sorry for the late reply. I solved the problem later and the SSH command for connection to my server is now working via codeship but only for one project. I Created setup another separate project and repeated the steps: 1. Added the project ssh-rsa key to my server 2. Tried to connect to the other project via SSH on the SAME server but did not succeed. Any idea why? Thanks! – Ivica Apr 20 '18 at 13:50
  • Same problem here! – Code Cooker Apr 13 '20 at 12:05

0 Answers0