wp-deploy-flow
wp-deploy-flow copied to clipboard
Connect to ssh using public/private key
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
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.
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.
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..:/