diff --git a/ssh.exe-examples.md b/ssh.exe-examples.md index b5dc791..4244cdd 100644 --- a/ssh.exe-examples.md +++ b/ssh.exe-examples.md @@ -9,25 +9,11 @@ ##### Login With SSH Keys - -**Client machine** +**Setup Server machine** *** - -1. Generate a key pair on the client: - * `ssh-keygen -t rsa -f id_rsa` -2. Register private key with ssh-agent (for single sign-on experience) - * `net start ssh-agent` - * `ssh-add id_rsa` -3. Copy `id_rsa.pub` (client's public key) to corresponding user's directory on ssh server machine +1. Copy `id_rsa.pub` (client's public key) to corresponding user's directory on ssh server machine * as `%systemdrive%\users\\.ssh\authorized_keys` (path on the ssh server machine) -4. Login using private key - * `ssh -i .\id_rsa user@host` (work group user) - * `ssh -i .\id_rsa -l user@domain host` (domain user) - -**Server machine** -*** - -1. Adjust permissions on authorized_keys file +2. Adjust permissions on authorized_keys file ``` $authorizedKeyPath = "%systemdrive%\users\user\.ssh\authorized_keys" $acl = get-acl $authorizedKeyPath @@ -36,6 +22,20 @@ Set-Acl $authorizedKeyPath $acl ``` +**Usage from Client machine** +*** + +1. Generate a key pair on the client: + * `ssh-keygen -t rsa -f id_rsa` +2. Register private key with ssh-agent (for single sign-on experience) + * `net start ssh-agent` + * `ssh-add id_rsa` +3. Login using private key + * `ssh -i .\id_rsa user@host` (work group user) + * `ssh -i .\id_rsa -l user@domain host` (domain user) + + + ##### For Unix and Linux users The [Modern Unix Rosetta Stone](https://certsimple.com/rosetta-stone) includes Powershell examples of common Unix and Linux commands. \ No newline at end of file