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

Add username to log output for each executed command. #5

Merged

Conversation

asemt
Copy link
Contributor

@asemt asemt commented Aug 6, 2015

This pull request contains a really small change which only adds the the SSH username to the log output (where username and host are separated by the @ symbol). The actual username value is the one parsed from the User ssh-config directive. This way it's easier to spot under which user the command was actually executed on the remote host (without consulting the ~/.ssh/config file).

An example run would now look like (where username would be the value of the User directive for a host called example.org in the ~/.ssh/config file):

$ ./slex --host example.org --agent uptime
INFO[0000] Session complete from username@example.org:22
 17:34:09 up 183 days, 47 min,  2 users,  load average: 2.59, 2.71, 2.72 

@crosbymichael
Copy link
Owner

LGTM

Thanks!

crosbymichael added a commit that referenced this pull request Aug 6, 2015
Add username to log output for each executed command.
@crosbymichael crosbymichael merged commit 00f44a1 into crosbymichael:master Aug 6, 2015
@asemt asemt deleted the show-ssh-username-for-cmd branch August 7, 2015 09:08
@asemt
Copy link
Contributor Author

asemt commented Aug 7, 2015

Thank you for merging it (and so fast)!

Best,
Andreas

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

Successfully merging this pull request may close these issues.

2 participants