-
Notifications
You must be signed in to change notification settings - Fork 214
Use the username provided in GCP address to ssh #126
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. These commits need to be signed with PGP before I can merge them though.
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@InstanceName
it'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]