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 (u-root#280)
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]> Co-authored-by: Ron Minnich <[email protected]>
- Loading branch information