Efectivamente, si intentamos acceder a un Ubuntu recién instalado puede que no nos traiga el SSH (Secure Shell) instalado, por ello, si intentamos acceder a nuestra máquina (en este caso local) con:
ssh usuario@192.168.1.88
Nos responderá:
ssh: connect to host 192.168.1.88 port 22: Connection refused
Y esto se debe a que no está instalado (o activo) el servicio.
Para su instalación es tan sencillo como ejecutar:
sudo apt-get install openssh-server
¡Y ya debería de funcionar!
Intentamos acceder de nuevo :
ssh usuario@192.168.1.88
y…
The authenticity of host ‘192.168.1.88 (192.168.1.88)’ can’t be established.
ECDSA key fingerprint is SHA256:hsfgHSOAJSDG+/HKAHD8as8fdg8asdfASHFS.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.1.88’ (ECDSA) to the list of known hosts.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for ‘/Users/kikebeltran/.ssh/id_rsa’ are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key «/Users/kikebeltran/.ssh/id_rsa»: bad permissions
usuario@192.168.1.88’s password:
Y os dejo algunos comandos para diferentes opciones…
Para arrancar el servidor:
sudo /etc/init.d/ssh start
Para saber el estado el servidor:
sudo /etc/init.d/ssh status
Nos responde:
sudo /etc/init.d/ssh status
● ssh.service – OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-02-28 17:57:25 CET; 18s ago
Main PID: 12115 (sshd)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/ssh.service
└─12115 /usr/sbin/sshd -D
Para parar el servidor:
sudo /etc/init.d/ssh stop
Para reiniciar el servidor:
sudo /etc/init.d/ssh restart
Y para la configuración del servidor SSH:
sudo gedit /etc/ssh/sshd_config
Si interesa más el tema comentad y explicaré algunas configuraciones avanzadas.