sshcode icon indicating copy to clipboard operation
sshcode copied to clipboard

Resolving multiple auth requests

Open evanaze opened this issue 5 years ago • 15 comments

I thought I was pretty slick with my current solution to using code-server with sshcode from Mac to my Ubuntu machine: ~/workspace/.server/sshcode --upload-code-server ~/workspace/.server/code-server me@my_ip, but I am consistently getting this error: ERROR failed to start SSH master connection: SSH master wasn't ready on time: max number of tries exceeded: 30.

After this point I am forced to authenticate multiple times. Anybody know how to resolve the need for multiple authentications? The error is risen from this section in the source code: if o.reuseConnection {...} when starting the master connection socket. I am running sshcode 0.10.0 and code-server 3.2.0. Thanks!

evanaze avatar May 03 '20 22:05 evanaze

can you post the entirety of your terminal output? from the moment you open the terminal, to when you close code-server?

Merith-TK avatar May 04 '20 01:05 Merith-TK

 ~  ~/workspace/.server/sshcode --upload-code-server ~/workspace/.server/code-server evan@my_ip
2020-05-03 19:05:42 INFO	starting SSH master connection...
Enter passphrase for key '/Users/evanazevedo/.ssh/id_rsa':
evan@my_ip's password:
2020-05-03 19:06:12 ERROR	failed to start SSH master connection: SSH master wasn't ready on time: max number of tries exceeded: 30
2020-05-03 19:06:12 INFO	uploading local code-server binary...
Enter passphrase for key '/Users/evanazevedo/.ssh/id_rsa':
evan@my_ip's password:
building file list ... done

sent 92 bytes  received 20 bytes  9.74 bytes/sec
total size is 582  speedup is 5.20
Enter passphrase for key '/Users/evanazevedo/.ssh/id_rsa':
evan@my_ip's password:
2020-05-03 19:06:29 INFO	syncing settings
Enter passphrase for key '/Users/evanazevedo/.ssh/id_rsa':
evan@my_ip's password:
building file list ... done
deleting state/global.json
deleting state/144d15a3.json
deleting state/
./

sent 333 bytes  received 26 bytes  65.27 bytes/sec
total size is 385649  speedup is 1074.23
2020-05-03 19:06:34 INFO	synced settings in 4.938063272s
2020-05-03 19:06:34 INFO	syncing extensions
Enter passphrase for key '/Users/evanazevedo/.ssh/id_rsa':
evan@my_ip's password:
building file list ... done

sent 254340 bytes  received 20 bytes  26774.74 bytes/sec
total size is 389093594  speedup is 1529.70
2020-05-03 19:06:43 INFO	synced extensions in 14.346690576s
2020-05-03 19:06:43 INFO	starting code-server...
2020-05-03 19:06:43 INFO	Tunneling remote port 12364 to 127.0.0.1:27639
Enter passphrase for key '/Users/evanazevedo/.ssh/id_rsa':
evan@my_ip's password:
info  Server listening on http://127.0.0.1:12364
info    - No authentication
info    - Not serving HTTPS

Then it loads successfully. I close it and the output is:

2020-05-03 19:08:58 INFO	shutting down
2020-05-03 19:08:58 ERROR	failed to send SIGTERM to SSH master process: os: process already finished

evanaze avatar May 04 '20 02:05 evanaze

I am experiencing the same issue on MacOS (local) and ubuntu (remote). I can eventually log in, but it always takes a failure and several attempts to do so. The terminal output is similar.

Bai-Li avatar May 06 '20 04:05 Bai-Li

currently the only fix for this that i can think of, is using an sshkey

Merith-TK avatar May 06 '20 16:05 Merith-TK

Doesn't Enter passphrase for key '/Users/evanazevedo/.ssh/id_rsa': Show that I am using an sshkey?

evanaze avatar May 08 '20 22:05 evanaze

oh, Sorry not used to seeing that, Could not be properly forming a "master" ssh connection I know this had to be disabled on msys2 builds in my fork when on windows If i had a Mac i would test this out.

when sshcode is running, after the first password prompt

	sshDirectory               = "~/.ssh"
	sshDirectoryUnsafeModeMask = 0022
	sshControlPath             = sshDirectory + "/control-%h-%p-%r"

is there a control-*-*-* file in your ~/.ssh directory?

Merith-TK avatar May 08 '20 23:05 Merith-TK

Yes, there are two. One with the name of my local machine and the other with the name of the one I am trying to ssh into.

Also may be worth mentioning, is that I am attempting to use this with Ubuntu 18.04.

evanaze avatar May 09 '20 20:05 evanaze

I think you already mentioned that.

are those files there when sshcode is not running?

Merith-TK avatar May 09 '20 21:05 Merith-TK

Yes, they are still there.

evanaze avatar May 15 '20 19:05 evanaze

try deleting them you may have to use sudo

Merith-TK avatar May 15 '20 22:05 Merith-TK

Thanks. I deleted them and ran sshcode. I got this error:

error: failed to sync extensions: failed to rsync '/Users/evanazevedo/.vscode/extensions/' to 'evan@my-ip:~/.local/share/code-server/extensions/': exit status 23

evanaze avatar May 15 '20 22:05 evanaze

does the folder exist on both machines?

Merith-TK avatar May 15 '20 22:05 Merith-TK

or if you dont care for syncing, --skipsync

Merith-TK avatar May 15 '20 22:05 Merith-TK

I just checked, and both of the directories exist. And they seem to be identical. I also just tried running sshcode both with and without --skipsync and I am getting the same error in the original posting.

Do you think it may have to do with me running Ubuntu 18.04 on my remote machine?

evanaze avatar May 15 '20 22:05 evanaze

No, it works just fine for me on my machine, I run ubuntu 18.04 as well on the remote, as well as arch. Clients im testing with are Arch and windows 10

Pretty much the only difference between our setups are as follows

  1. Your using MacOS
  2. your using a password protected key.

can you temporarily use no sshkey? or is that out of the option?

Merith-TK avatar May 15 '20 22:05 Merith-TK