shipitjs / shipit-deploy

Set of deployment tasks for Shipit based on git and rsync commands.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

deploy:update Authentication Failed

rphovley opened this issue · comments

When running shipit, I get an Authentication failed error only only on a certain command.

if [ -f /home/deploy/www/notis/releases/20170629193844/REVISION ]; then cat /home/deploy/www/notis/releases/20170629193844/REVISION 2>/dev/null; fi;

If I run this command locally through ssh, it succeeds with no issues.

Since I have access to the server, can ssh and run this command successfully, and shipit runs other commands on the server successfully, it makes me think that there isn't an Authentication problem (or if there is, that shipit is getting its auth from somewhere other than the normal .ssh/ for this one command for some reason).

Running 'deploy:update' task...
Running "if [ -h /home/deploy/www/notis/current ]; then readlink /home/deploy/www/notis/current; fi" on host "104.236.135.251".
@104.236.135.251 releases/20170629193844
Previous release found.
Running "if [ -f /home/deploy/www/notis/releases/20170629193844/REVISION ]; then cat /home/deploy/www/notis/releases/20170629193844/REVISION 2>/dev/null; fi;" on host "104.236.135.251".
@104.236.135.251-err Authentication failed.
'deploy:update' errored after 59 s
Error: Command failed: ssh deploy@104.236.135.251 "if [ -f /home/deploy/www/notis/releases/20170629193844/REVISION ]; then cat /home/deploy/www/notis/releases/20170629193844/REVISION 2>/dev/null; fi;"
Authentication failed.

    at ChildProcess.exithandler (child_process.js:211:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:885:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

Hi, are you correctly authenticated using your ssh key? It's probably relative to your SSH configuration.

Yeah, I can ssh into the remote machine, or run commands on the remote machine through ssh.

I haven't done any special configurations on my local aside from putting my id_rsa.pub in the remotes authorized keys for the user I'm logging in as.

I feel like this is likely something silly/small but I have not been able to identify anything unique about this particular configuration yet

The reason in my case was that firewall on server accepted only 5 ssh login in one minute.
Changing value of hit_count in UFW helped.