Skip to content
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

Connect to ssh using public/private key #14

Open
sushicodeur opened this issue Jul 4, 2014 · 3 comments
Open

Connect to ssh using public/private key #14

sushicodeur opened this issue Jul 4, 2014 · 3 comments

Comments

@sushicodeur
Copy link

Hello,

I'm accessing my staging environment using public/private key authentication and an alias in my ~/.ssh/config file. Thus, accessing my staging server with ssh is only done like this :

ssh my-staging

I installed this plugin, it works in --dry-run mode, but in live mode, I'm asked for a password that is not my key passphrase.

It looks like the rsync command is issued like that :
rsync -avz -e 'ssh -p 22' @My-Staging:/path (etc)

I modified puller.php to add @ mark only if $ssh_user is set which works better with this setup. Before I submit a pull request, is there another way to handle this kind of ssh authentication that I haven't found yet ?

Btw, many thanks for this plugin that is exactly what I wanted to do :)

Alain

@demental
Copy link
Owner

demental commented Jul 4, 2014

Hi,
sshing without specifying a username takes as default username your current, local account.
So if you're logged in on your local computer as sushicodeur, it's the same as ssh sushicodeur@my-staging

Therefore, you must set 'sushicodeur' as the $ssh_user in your deployment config.

@sushicodeur
Copy link
Author

Well, that's true, I can use the user that is defined in my alias, thanks for your reply.

In fact I'm used to connect just by specifying the alias name, like "ssh my-staging" and the user is taken in the alias definition :

Host my-staging
  Hostname ssh.myhost.com
  User mysshuser
  IdentitiesOnly yes
  IdentityFile ~/.ssh/mykey.id_rsa

If I use "ssh @My-Staging" then it overrides the alias user with my system login and doesn't works.

But no problem, I'll connect with "ssh mysshuser@my-staging" instead.

@demental
Copy link
Owner

demental commented Jul 4, 2014

Fine, you still can submit a PR with this, this makes sense . FYI I'm not using wp-deploy-flow anymore (I'm not using wp anymore), so this project is kind of abandoned..:/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants