mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-26 23:44:35 +02:00
Updated ssh.exe examples (markdown)
parent
ea79d69d07
commit
b74ef0952e
@ -10,14 +10,24 @@
|
||||
|
||||
##### Login With SSH Keys
|
||||
|
||||
**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. Copy `id_rsa.pub` (client's public key) to corresponding user's directory on ssh HOST
|
||||
* as `%systemdrive%\users\user\.ssh\authorized_keys`
|
||||
4. Adjust permissions on authorized_keys file
|
||||
3. 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)
|
||||
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
|
||||
```
|
||||
$authorizedKeyPath = "%systemdrive%\users\user\.ssh\authorized_keys"
|
||||
$acl = get-acl $authorizedKeyPath
|
||||
@ -25,9 +35,6 @@
|
||||
$acl.SetAccessRule($ar)
|
||||
Set-Acl $authorizedKeyPath $acl
|
||||
```
|
||||
5. 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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user