-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client: add GetHostUser for u@host and .ssh/config
Since 2017 cpu used $USER as the user. Now that it supports ssh, it needs better processing. Add GetHostUser, which takes a string in [user@]host form, and returns a host and user name as follows: if user@host form, return the host and user. Look up the host in .ssh/config; if found, and there is a UserName record, return that UserName Otherwise return host and $USER. If a host entry is found in .ssh/config, the HostName from that entry is used. This means that code that used GetHost should start using GetHostUser. Signed-off-by: Ron Minnich <[email protected]>
- Loading branch information
1 parent
a0eb86c
commit 7132caa
Showing
4 changed files
with
49 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters