Use the username provided in GCP address to ssh#126
Use the username provided in GCP address to ssh#126deansheather merged 2 commits intocoder:masterfrom
Conversation
|
I don't have gcloud, so could you please explain how this PR makes |
|
The dryRumCmd( Now this works good if we(sshcode) wanna use the current localUser to ssh, so if we use Before my commit, we were ignoring this username (comment mentioning it at line 556), by returning the userIP, we retain the username provided by the user and ssh to the correct user on the instance. |
deansheather
left a comment
There was a problem hiding this comment.
Lines 555 to 565 should be removed since they are unneccessary. Other than that, LGTM.
|
Ah, thanks for pointing that out, I was reluctant on remove that part becuase it was checking that the IP Address was valid, your comment made me to do some digging, and yes, it NEEDS to be gone, its not just unnecessory, but a bug on its own. Will push the change soon and add this to first message. |
|
Ok, so I was testing my changes out for instances with no external IP, and I found that instances with no external IP addresses cant connect to internet. |
Signed-off-by: Sahil Soni <[email protected]>
This is not needed since dry-run will provide a working host, or will throw error anyways
Signed :) |
Earlier if the user did something like this:
localUser@localhost:~$ sshcode gcp:userName@InstanceNameit'd still be ssh as localUser@InstanceName , thats because only IP was returned and when that's the case, ssh tries to use the current username for remote machine,
This fixes that.
Tested on my machine(Manjaro Linux).
Signed-off-by: Sahil Soni [email protected]