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

Does this work with svn+ssh/rsa (passphrase protected) + SSH-Remote #893

Closed
ghostkadost opened this issue Apr 16, 2020 · 23 comments
Closed

Comments

@ghostkadost
Copy link

  • VS Code Version: 1.44.1
  • OS: Darwin x64 19.4.0
  • Remote host : Linux
  • svn, version 1.10.2 (r1835932)
  • Remote-ssh : 0.51.0
  • svn extension 2.10.6
  • svn gutter 0.5.2

Issue
I use svn+ssh with rsa keys protected with a passphrase.

Unable to do a diff between head and local, unable to view file history, commit, etc. The only operation that works is "show all diff patches"

This is how the file diff looks like. I have masked the actual contents of the file.

svn-1

This is how svn file history and repository status looks like. I have only masked the repo name and file name.

svn-2

I am running ssh-agent on the remote host and appropriate keys are added. I am able to perform all svn operations from the integrated terminal and can verify that the ssh-agent related environment is properly set up

Similarly, the SVN gutter extension throws the following error while executing "show blame"

svn: E170013: Unable to connect to a repository at URL 'svn+ssh://svn@' svn: E210002: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file. svn: E210002: Network connection closed unexpectedly

Here is the .ssh/config file section for connecting to svn

Host *-svn-0*
User svn
IdentityFile /homes/user-name/.ssh/id_rsa

@JohnstonCode
Copy link
Owner

Do you get any errors in the SVN extension output when you try running on of the failed commands?

@ghostkadost
Copy link
Author

How do we check the extension output?

@JohnstonCode
Copy link
Owner

View >> Output then select svn

@ghostkadost
Copy link
Author

Yeah got that. This on triggering diff between HEAD and local.

[work]$ svn info --xml
[work]$ svn cat -r HEAD svn+ssh://svn@"file_path"
[work]$ svn: E170013: Unable to connect to a repository at URL 'svn+ssh://svn@fie_path'
[work]$ svn: E210002: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
[work]$ svn: E210002: Network connection closed unexpectedly[work]$ svn info --xml full_path_of_file

@JohnstonCode
Copy link
Owner

If you copy and paste the svn cat line and run it in the terminal does it work?

@ghostkadost
Copy link
Author

Yes. The contents of the file are displayed if I run this from the integrated terminal.

@JohnstonCode
Copy link
Owner

Do you get a prompt for the ssh passphrase?

@ghostkadost
Copy link
Author

No. As I mentioned ssh-agent takes care of that.

@JohnstonCode
Copy link
Owner

Okay I've not had this issue before using svn+ssh I will try to reproduce however.

@ghostkadost
Copy link
Author

Is there a way to remove the -q option as suggested in the error message?

@JohnstonCode
Copy link
Owner

I'm not sure never had to do it before

@JohnstonCode
Copy link
Owner

Not able to replicate.
image
image

@ghostkadost
Copy link
Author

I figured out how to enable verbose logging for tunnels in svn. Here is what I see
[work]$ debug1: Offering RSA public key: /homes/user_name/.ssh/id_rsa
[work]$ debug3: send_pubkey_test
[work]$ debug3: send packet: type 50
[work]$ debug2: we sent a publickey packet, wait for reply
[work]$ debug3: receive packet: type 60
[work]$ debug1: Server accepts key: pkalg rsa-sha2-512 blen 277
[work]$ debug2: input_userauth_pk_ok: fp ---------------------------
[work]$ debug3: sign_and_send_pubkey: RSA ------------------------
[work]$ debug1: read_passphrase: can't open /dev/tty: No such device or address
[work]$ debug2: no passphrase given, try next key
[work]$ debug2: we did not send a packet, disable method
[work]$ debug3: authmethod_lookup password
[work]$ debug3: remaining preferred: ,password

Is there a way to setup the connection with ssh-agent like the integrated terminal or prompt for pass phrase?

@JohnstonCode
Copy link
Owner

Not for ssh there isn't.

@ghostkadost
Copy link
Author

My apologies if I am dragging this. The Remote-SSH extension can prompt for pass-phrase. Can something be borrowed from there?

@JohnstonCode
Copy link
Owner

I don't think so as they are using ssh directly whereas this extension is using svn i cant catch anything as it has already failed.

@JohnstonCode
Copy link
Owner

If the ssh agent is running you shouldn't need to enter a password

@ghostkadost
Copy link
Author

From the integrated shell

[work]$ echo $SSH_AGENT_PID
255
[work]$ ps ux | grep ssh-agent
user 255 0.0 0.0 11144 308 ? Ss Apr06 0:00 ssh-agent
[work]$ echo $SSH_AUTH_SOCK
/tmp/ssh-8vt0fQEukMtJ/agent.254

Thanks for patiently answering my queries.

@JohnstonCode
Copy link
Owner

i do get something different if i do ps ux | grep ssh-agent it lists my keyring
/usr/bin/ssh-agent -D -a /run/user/1000/keyring/.ssh

@JohnstonCode
Copy link
Owner

Not sure how keyring and ssh work on Mac

@ghostkadost
Copy link
Author

Your comment on ssh-agent made me wonder if there is something wrong in my environment. Played around with the setting of SSH_AUTH_SOCK and happy to report that everything now works link a charm.

Thanks a lot.

@JohnstonCode
Copy link
Owner

Glad to hear that you managed to get it working.

@wwiki
Copy link

wwiki commented May 20, 2020

I got the same issue after updated to macOS 10.15.4 😭
Fixed by pasting in Terminal: ssh-add -K ~/.ssh/id_rsa
Works now.
Thanks for the great extension Christopher!!

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

No branches or pull requests

3 participants