(16)(18)
apt install openssh-server
systemctl enable ssh
systemctl restart ssh
(9)
apt install openssh-server
systemctl enable ssh
systemctl restart ssh
(7)
yum install openssh-server
systemctl enable sshd
systemctl restart sshd
- Windows Server
(2012R2)
https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH
https://github.com/PowerShell/Win32-OpenSSH/wiki/ssh.exe-examples
-1.sshサーバインストール
「OpenSSH-Win64.zip」をダウンロードし、展開
管理者としてPowerShellを起動
cd C:\test\OpenSSH-Win64
powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
net start sshd
→C:\ProgramData\sshにキーが作成される
--3.sshサーバ側の設定
cd C:\Users\Administrator
mkdir .ssh
cd .ssh
copy nul authorized_keys
icacls C:\Users\Administrator\.ssh\authorized_keys
--4.sshログイン
ssh Administrator@192.168.137.61