En Ubuntu, habilite ssh para conectarse y administrar el servidor de forma remota: Cómo

Después de instalar el servidor o el escritorio de Ubuntu, tienes una pregunta:¿Está SSH habilitado de forma predeterminada en Ubuntu?? Entonces la respuesta es absolutamente 'NO'. El usuario o administrador debe instalar o habilitar SSH manualmente activando solo un comando de una línea que mostraremos en este artículo. Pero antes de eso veamos¿Qué es SSH?

ElShell seguro (SSH)Es un protocolo que nos permite conectar el servidor o escritorio de Ubuntu de forma remota a través de un canal seguro. Permite ejecutar de forma remota todos los comandos que podemos ejecutar físicamente en el servidor. Incluso el usuario puede ejecutar programas gráficos y de línea de comandos, transferir archivos e incluso crear redes privadas virtuales seguras a través de Internet. Fue desarrollado por el Grupo de Trabajo de Red del IETF y es un protocolo más confiable que brinda seguridad para sesiones de inicio de sesión remotas y otros servicios de red. SSH era originalmente un programa en un sistema UNIX y luego se expandió rápidamente a otras plataformas operativas. El cliente SSH está disponible en múltiples plataformas, incluidas Linux, Solaris, Windows, MacOS y otras.

Aquí te contamos cómo habilitar SSH en Ubuntu (18.04, 17.04, 16.04, 14.04…) o Linux Mint.

  1. Abre elterminación de comandol en el servidor o escritorio de Ubuntu.
  2. Para abrir la terminal de comando en el modo gráfico, el usuario puede usar el acceso directoCTRL+ALT+T
  3. Inicie sesión como usuario estándar o root. Para root se puede usarsudo-i
  4. Ejecute el comando:sudo apt-get instalar ssh
  5. El comando anterior instalará tres paquetes:Cliente OpenSSH, servidor OpenSSH y servidor OpenSSH-SFTP.
  6. Una vez que elServidor SSH instalado, use este comando para habilitarlo en Ubuntu:inicio del servicio sudo ssh
  7. Ahora verifique el estado del servidor SSH en Ubuntu usando:estado ssh del servicio sudo

Si desea editar algunas configuraciones de SSH, como el puerto de escucha, el permiso de inicio de sesión de root y más, puede hacerlo editando el archivo de configuración mediante este comando:

sudo nano /etc/ssh/sshd_config

El resultado de todos los comandos anteriores:

h2s@DESKTOP-N53EEI1:~$ sudo apt-get install ssh
[sudo] password for h2s:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libgsoap-2.8.60 libvncserver1
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
openssh-client openssh-server openssh-sftp-server
Suggested packages:
keychain libpam-ssh monkeysphere ssh-askpass molly-guard rssh
The following NEW packages will be installed:
ssh
The following packages will be upgraded:
openssh-client openssh-server openssh-sftp-server
3 upgraded, 1 newly installed, 0 to remove and 174 not upgraded.
Need to get 997 kB of archives.
After this operation, 106 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://archive.ubuntu.com/ubuntu bionic-updates/main amd64 openssh-sftp-server amd64 1:7.6p1-4ubuntu0.3 [45.6 kB]
Get:2 https://archive.ubuntu.com/ubuntu bionic-updates/main amd64 openssh-server amd64 1:7.6p1-4ubuntu0.3 [333 kB]
Get:3 https://archive.ubuntu.com/ubuntu bionic-updates/main amd64 openssh-client amd64 1:7.6p1-4ubuntu0.3 [614 kB]
Get:4 https://archive.ubuntu.com/ubuntu bionic-updates/main amd64 ssh all 1:7.6p1-4ubuntu0.3 [5204 B]
Fetched 997 kB in 5s (197 kB/s)
Preconfiguring packages ...
(Reading database ... 99318 files and directories currently installed.)
Preparing to unpack .../openssh-sftp-server_1%3a7.6p1-4ubuntu0.3_amd64.deb ...
Unpacking openssh-sftp-server (1:7.6p1-4ubuntu0.3) over (1:7.6p1-4) ...
Preparing to unpack .../openssh-server_1%3a7.6p1-4ubuntu0.3_amd64.deb ...
Unpacking openssh-server (1:7.6p1-4ubuntu0.3) over (1:7.6p1-4) ...
Preparing to unpack .../openssh-client_1%3a7.6p1-4ubuntu0.3_amd64.deb ...
Unpacking openssh-client (1:7.6p1-4ubuntu0.3) over (1:7.6p1-4) ...
Selecting previously unselected package ssh.
Preparing to unpack .../ssh_1%3a7.6p1-4ubuntu0.3_all.deb ...
Unpacking ssh (1:7.6p1-4ubuntu0.3) ...
Processing triggers for ufw (0.35-5) ...
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for systemd (237-3ubuntu10.3) ...
Processing triggers for man-db (2.8.3-2) ...
Setting up openssh-client (1:7.6p1-4ubuntu0.3) ...
Setting up openssh-sftp-server (1:7.6p1-4ubuntu0.3) ...
Setting up openssh-server (1:7.6p1-4ubuntu0.3) ...
Creating SSH2 RSA key; this may take some time ...
2048 SHA256:5AdbGb5TQhr0muu4hOz49gdBC8iRRqonYXv0s0JUUHE root@DESKTOP-N53EEI1 (RSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:m1ibvVu6wqieTG8Yd98ocAHv3X6XqYCuhx56zq7Jgzc root@DESKTOP-N53EEI1 (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:SF2xPgLXsCG1Z6yEF7/+wrqTxxptiyuimxgnC7XVpwc root@DESKTOP-N53EEI1 (ED25519)
invoke-rc.d: could not determine current runlevel
Setting up ssh (1:7.6p1-4ubuntu0.3) ...
h2s@DESKTOP-N53EEI1:~$ sudo service ssh status
* sshd is not running
h2s@DESKTOP-N53EEI1:~$ sudo apt-get install openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
openssh-server is already the newest version (1:7.6p1-4ubuntu0.3).
The following packages were automatically installed and are no longer required:
libgsoap-2.8.60 libvncserver1
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 174 not upgraded.
h2s@DESKTOP-N53EEI1:~$ sudo service ssh start
* Starting OpenBSD Secure Shell server sshd [ OK ]
h2s@DESKTOP-N53EEI1:~$ sudo service ssh status
* sshd is running
h2s@DESKTOP-N53EEI1:~$

Otros tutoriales útiles:

Related Posts