Saltar al contenido principal
Soporte
0
Contacta con nosotros
English
Nederlands
Deutsch
Servidores dedicadosFlexible VPSTecnología de nubeUbicación compartidaDesafíos en TISectoresCareers
Cloud Compute

Con Cloud Compute, tendrás acceso a un portal desde el que podrás configurar todo tu entorno informático en cualquier momento y desde cualquier lugar del mundo.

Almacenamiento en la nube

Acceso fiable a tus archivos, infraestructura y aplicaciones en todo momento, sin interrupciones ni retrasos. En Worldstream, ofrecemos una gran variedad de soluciones de almacenamiento.

Flexible cloud icon
Nube flexible
Private cloud icon
Nube privada
Bare metal icon
Bare Metal Compute
Hollow cube icon
Almacenamiento de objetos
Hollow cube icon
Almacenamiento de archivos
Block storage icon
Almacenamiento en bloque
Backup storage icon
Almacenamiento de copias de seguridad
¿Necesitas soporte?

Con ingenieros experimentados y un tiempo medio de respuesta de 7 minutos, puedes esperar una solución de soporte técnico sólida muy rápida.

Soporte
Todos los servidores

Elige tu servidor dedicado ahora. Configuración personalizada o entrega inmediata. Servidores potentes diseñados para tu caso de uso.

Casos de uso

Sea cual sea tu caso de uso, te ayudamos a encontrar la solución adecuada.

Deal servers icon
Ofertas
AMD servers icon
Servidores AMD
AI servers icon
Servidores Intel
Hollow cube icon
Virtualización, Contenerización y Orquestación
Hollow cube icon
Sitios web y aplicaciones
Hollow cube icon
Infraestructura para gaming y streaming

Soporte 24/7/365 con un tiempo medio de respuesta de solo 7 minutos. Gracias a nuestros propios centros de datos, nuestros ingenieros pueden acceder directamente a tu servidor para ofrecer soporte rápido y directo. Contáctanos por correo o teléfono en cualquier momento.

Soporte
Externalización inteligente

Algunos aspectos de la TI crean valor añadido, mientras que otros sirven de apoyo. Aprovéchalo como punto de partida para la externalización.

Rentabilidad

Los paquetes informáticos completos pueden parecer la opción segura, pero al considerar los costes, otras opciones suelen tener más sentido.

Flexibilidad y control informáticos

Externalizar no implica perder el control; en realidad proporciona más flexibilidad y control.

Repatriación desde la nube

La nube no es el destino final: debes evaluar y ajustar tu entorno de nube continuamente a medida que cambian las necesidades.

Servicios financieros
Logística y transporte
Venta minorista y comercio electrónico
Medios de comunicación y entretenimiento
Tecnología y desarrollo de software
Seguridad
Proveedores de servicios gestionados
¿Necesitas soporte?

Con ingenieros experimentados y un tiempo medio de respuesta de 7 minutos, puedes esperar una solución de soporte técnico sólida muy rápida.

Habla con nosotrosContacta con nosotros
Acerca de WorldstreamAcerca de la tecnologíaCasosBase de conocimientos
Quiénes somosConoce al equipoTrabaja con nosotrosHazte distribuidorcertificacionesNuestros centros de datosNuestra redProtección DDoSServidores AMD EPYCPartners tecnológicosAcerca de los servidores dedicadosTodos los casosEasyTerraDutch Drone CompanyPerfGridArtículosPreguntas frecuentesNoticias y blogsProductos y servicios
Contacta con nosotros

Llama al +31 (0) 174 – 712 117 Industriestraat 53, Naaldwijk

Contacta con nosotros
Worldstream Portal
English
Nederlands
Deutsch
0
Servidores dedicadosFlexible VPSTecnología de nubeUbicación compartidaDesafíos en TISectoresCareersAcerca de WorldstreamAcerca de la tecnologíaCasosBase de conocimientosMy Worldstream
Contact
Soporte
EnglishNederlandsDeutsch
  1. InicioInicio
  2. Base de conocimientos
  3. Security
  4. How to change the SSH port

How to change the SSH port

Se aplica a Dedicated servers, Flexible VPS (Linux)Audiencia Server administratorsÚltima revisión September 2026

Respuesta rápida

Edit /etc/ssh/sshd_config, change the Port line to your chosen port, open that port in your firewall, then restart the SSH service. Two extra steps catch people out: recent Ubuntu releases set the port on ssh.socket instead, and RHEL-family distributions need the new port labelled in SELinux first.

Moving SSH off port 22 doesn't make your server unbreakable, but it does cut down sharply on the automated scanning traffic that hits every server on the default port. Use it alongside key-based authentication and the other steps in How to improve your SSH security, not instead of them.

Change the port

1

Choose a port

Pick an unused port above 1024 to avoid the reserved system port range. Check it isn't already used by another service on the server.

2

Edit sshd_config

Open /etc/ssh/sshd_config in a text editor and find the Port line. Uncomment it if needed, and set it to your chosen port number.

Port 2222

On recent Ubuntu releases, check for socket activation first. From Ubuntu 22.10 onwards, sshd is started by a systemd socket unit. When that unit is active, the Port directive in sshd_config is ignored and the listening port comes from the socket instead, so the change appears to work but nothing moves. Check it:

systemctl is-enabled ssh.socket

If that returns enabled, set the port on the socket as well:

sudo systemctl edit ssh.socket

Add the following, clearing the inherited value first:

[Socket]
ListenStream=
ListenStream=2222

Then reload and restart the socket:

sudo systemctl daemon-reload
sudo systemctl restart ssh.socket
3

Allow the new port through the firewall

Open the new port in whatever firewall the server runs, for example UFW, firewalld, or iptables, before you restart SSH. Leave the old port open until you've confirmed the new one works.

# UFW example
sudo ufw allow 2222/tcp
4

Restart the SSH service

On RHEL-family distributions, tell SELinux about the port first. On AlmaLinux, Rocky Linux, CentOS Stream and Oracle Linux, SELinux is enforcing by default and will not let sshd bind to a port outside its own policy, so the restart fails with a permission or bind error. Label the new port before restarting:

sudo dnf install policycoreutils-python-utils
sudo semanage port -a -t ssh_port_t -p tcp 2222

Check the configuration for syntax errors, then restart:

sudo sshd -t
sudo systemctl restart sshd

On Debian and Ubuntu the service is called ssh rather than sshd. If you changed ssh.socket in step 2, restarting the socket is what puts the new port into effect.

5

Test before you disconnect

Open a new terminal window and connect on the new port without closing your existing session:

ssh -p 2222 user@your-server-ip

Only close your original session once the new connection works. If it fails, your existing session lets you fix the configuration without being locked out.

6

Remove the old port from the firewall

Once you've confirmed the new port works, remove the rule allowing the old port (22) so it's no longer reachable.

Related articles

  • How to improve your SSH security
  • Two-factor authentication
¿Te ha resultado útil este artículo?

Informática sólida. Sin sorpresas

Tu socio para la madurez informática
Eliminamos barreras para que puedas correr
Costes previsibles y transparentes

Contacto

  • Industriestraat 53, Naaldwijk
Contacta con nosotros
Worldstream Portal (opens in a new tab)
  • Métodos de pago
  • Abuso
  • Recursos para desarrolladores
  • Centro de operaciones de red
  • Quiénes somos
  • Conoce al equipo
  • Trabaja con nosotros
  • Hazte distribuidor
  • certificaciones
  • Nuestros centros de datos
  • Nuestra red
  • Protección DDoS
  • Servidores AMD EPYC
  • Partners tecnológicos
  • Sistemas operativos
  • Vista general
  • Preguntas frecuentes
  • Casos
  • Noticias y blogs
  • Use Cases
English
Nederlands
Deutsch
English
Nederlands
Deutsch
  • Legal
  • Notificación de vulnerabilidades