I am trying to set up a Grunt task to ssh into a remote server and perform some operations using grunt-ssh. I am using git bash on a windows machine. The relevant parts of my Gruntfile.js are the following:
grunt.initConfig({
sshconfig: {
portfolioServer: {
host: 'myWebsite.com',
username: 'root',
agent: process.env.SSH_AUTH_SOCK,
}
},
sshexec:{
deploy:{
command: [
'cd portfolio',
'git pull'
].join(' && ')
},
options:{
config: 'portfolioServer'
}
},
........etc.
grunt.loadNpmTasks('grunt-ssh');
My problem is that when I run my grunt deploy
task, i get the following error:
Running "sshexec:deploy" (sshexec) task
Warning: Connection :: error :: Error: Malformed cygwin unix socket file Use --force to continue.
Aborted due to warnings.
If I then run using the --force
flag, I get the following output:
Running "sshexec:deploy" (sshexec) task
Warning: Connection :: error :: Error: Malformed cygwin unix socket file Used --force, continuing.
Warning: Connection :: error :: Error: Authentication failure. Available authentication methods: publickey,password Used --force, continuing.
Done, but with warnings.
This seems to suggest I have either set up my SSH authentication incorrectly, or that the commands I have used to get the command line to recognize my keys are poorly formed. This confuses me a little, as I have followed the instructions here to set up SSH keys on the command line, and am able to successfully ssh into my server by typing ssh root@myWebsite.com
What is going wrong?