Created
December 27, 2018 18:31
-
-
Save edgardo001/c059a6aa3e25154a1927e321dd0d39cb to your computer and use it in GitHub Desktop.
Instalar OpenSSH Server en Windows 10 y Windows Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NOTA: Ejecutar comandos sobre POWERSHELL con permisos de Administrador. | |
OpenSSH está incluido con Windows 10, Actualización 1803. | |
#Verificando las caracteristicas | |
$> Get-WindowsCapability -Online | Where-Object -Property Name -Like "OpenSSH*" | |
Name : OpenSSH.Client~~~~0.0.1.0 | |
State : Installed | |
Name : OpenSSH.Server~~~~0.0.1.0 | |
State : NotPresent | |
#Instalando la caracteristica OpenSSH.Server | |
$> Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 | |
#Confirmando que se haya instalado correctamente | |
$> Get-WindowsCapability -Online | Where-Object -Property Name -Like "OpenSSH.Server*" | |
Name : OpenSSH.Server~~~~0.0.1.0 | |
State : Installed | |
#Verificando el directorio de instalacion | |
$> Get-ChildItem C:\Windows\System32\OpenSSH\ | |
Directory: C:\Windows\System32\OpenSSH | |
Mode LastWriteTime Length Name | |
---- ------------- ------ ---- | |
-a---- 3/10/2018 12:20 PM 343552 scp.exe | |
-a---- 3/10/2018 8:20 PM 355840 sftp-server.exe | |
-a---- 3/10/2018 12:20 PM 408064 sftp.exe | |
-a---- 3/10/2018 12:20 PM 531968 ssh-add.exe | |
-a---- 3/10/2018 12:20 PM 495616 ssh-agent.exe | |
-a---- 3/10/2018 12:20 PM 657920 ssh-keygen.exe | |
-a---- 3/10/2018 12:20 PM 594944 ssh-keyscan.exe | |
-a---- 3/10/2018 8:20 PM 154624 ssh-shellhost.exe | |
-a---- 3/10/2018 12:20 PM 894464 ssh.exe | |
-a---- 3/10/2018 8:20 PM 970752 sshd.exe | |
-a---- 1/30/2018 7:55 PM 2143 sshd_config_default | |
#Verificando el servicio ssh | |
$> Get-Service -Name *ssh* | |
Status Name DisplayName | |
------ ---- ----------- | |
Stopped ssh-agent OpenSSH Authentication Agent | |
Stopped sshd OpenSSH SSH Server | |
#Habilitando el servicio para que se inicie junto al sistema | |
$> Get-Service -Name *ssh* | Set-Service -StartupType Automatic | |
#Iniciando servicio | |
$> Get-Service -Name *ssh* | Start-Service | |
#Verificar los puerto abiertos | |
$> netstat -bano | more | |
Active Connections | |
Proto Local Address Foreign Address State PID | |
TCP 0.0.0.0:22 0.0.0.0:0 LISTENING 12764 | |
[sshd.exe] | |
#Si se necesita realizar un cambio sobre ssh server, solo ir al archivo "sshd_config", luego reiniciar el servicio para que se confirmen los cambios | |
$> Get-ChildItem -Path 'C:\ProgramData\ssh\' | |
Directory: C:\ProgramData\ssh | |
Mode LastWriteTime Length Name | |
---- ------------- ------ ---- | |
d----- 5/17/2018 8:35 AM logs | |
-a---- 5/17/2018 8:35 AM 7 sshd.pid | |
-a---- 1/30/2018 4:55 PM 2143 sshd_config | |
-a---- 5/17/2018 8:35 AM 668 ssh_host_dsa_key | |
-a---- 5/17/2018 8:35 AM 613 ssh_host_dsa_key.pub | |
-a---- 5/17/2018 8:35 AM 227 ssh_host_ecdsa_key | |
-a---- 5/17/2018 8:35 AM 185 ssh_host_ecdsa_key.pub | |
-a---- 5/17/2018 8:35 AM 419 ssh_host_ed25519_key | |
-a---- 5/17/2018 8:35 AM 105 ssh_host_ed25519_key.pub | |
-a---- 5/17/2018 8:35 AM 1675 ssh_host_rsa_key | |
-a---- 5/17/2018 8:35 AM 405 ssh_host_rsa_key.pub | |
#Habilitando la regla para SSH sobre el puerto 22 en el firewall. | |
$> New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 | |
Name : sshd | |
DisplayName : OpenSSH Server (sshd) | |
Description : | |
DisplayGroup : | |
Group : | |
Enabled : False | |
Profile : Any | |
Platform : {} | |
Direction : Inbound | |
Action : Allow | |
EdgeTraversalPolicy : Block | |
LooseSourceMapping : False | |
LocalOnlyMapping : False | |
Owner : | |
PrimaryStatus : OK | |
Status : Se analizó la regla correctamente desde el almacén. (65536) | |
EnforcementStatus : NotApplicable | |
PolicyStoreSource : PersistentStore | |
PolicyStoreSourceType : Local | |
#Para remover la regla del firewall | |
$> Remove-NetFirewallRule –Name sshd | |
#Para reiniciar el servicio | |
$> Restart-Service -Name sshd | |
http://www.sqlservercentral.com/blogs/anthony-nocentinos-blog/2018/05/17/installing-openssh-server-on-windows-10/ | |
#Terminal #Microsoft |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment