-
Notifications
You must be signed in to change notification settings - Fork 780
ssh.exe examples
Yanbing edited this page May 12, 2017
·
38 revisions
- Work Group Users:
ssh user@host
- Domain Users: Domain needs to be explicitly specified. Any of the following formats would work:
ssh -l user@domain host
ssh domain\user@host
ssh user@domain@host
Setup Server machine
- Copy
id_rsa.pub
(client's public key) to corresponding user's directory on ssh server machine- as
%systemdrive%\users\<user>\.ssh\authorized_keys
(path on the ssh server machine)
- as
- Make sure the authorized_keys file is secured
$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
Usage from Client machine
- Generate a key pair on the client:
ssh-keygen -t rsa -f id_rsa
- Register secured private key with ssh-agent (for single sign-on experience)
net start ssh-agent
ssh-add id_rsa
- Login using secured private key.
-
ssh -i .\id_rsa user@host
(work group user) -
ssh -i .\id_rsa -l user@domain host
(domain user)
-
The Modern Unix Rosetta Stone includes Powershell examples of common Unix and Linux commands.
- MSI Install Instructions
- Script Install Instructions
- Alternative installation using the universal installer
- Retrieving download links for the latest packages