From 5b881de8ef29ff2f97456c6447ff1a51bf1ed6b9 Mon Sep 17 00:00:00 2001 From: Manoj Ampalam Date: Tue, 4 Apr 2017 12:57:43 -0700 Subject: [PATCH] Updated ssh.exe examples (markdown) --- ssh.exe-examples.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ssh.exe-examples.md b/ssh.exe-examples.md index 35f5a29..c7cc566 100644 --- a/ssh.exe-examples.md +++ b/ssh.exe-examples.md @@ -17,7 +17,14 @@ * `ssh-add.exe id_rsa` 3. Copy `id_rsa.pub` (client's public key) to corresponding user's directory on ssh HOST * as `%systemdrive%\users\user\.ssh\authorized_keys` -4. Login using private key +4. Adjust permissions on authorized_keys file +``` $authorizedKeyPath = "%systemdrive%\users\user\.ssh\authorized_keys" + $acl = get-acl $authorizedKeyPath + $ar = New-Object System.Security.AccessControl.FileSystemAccessRule("NT Service\sshd", "Read", "Allow") + $acl.SetAccessRule($ar) + Set-Acl $authorizedKeyPath $acl +``` +5. Login using private key * `ssh.exe -i .\id_rsa user@host` (work group user) * `ssh.exe -i .\id_rsa -l user@domain host` (domain user)