Ganti Port SSH di Ubuntu 18.04
How to Change SSH Port in Ubuntu 18.04
check port default ssh yang udah digunakan
netstat -tulnp | grep ssh

As you can see, the SSH daemon is currently running on TCP port 22.
cek konfigurasi saat ini
grep -i port /etc/ssh/sshd_config
The Port directive is commented out by default, which means SSH daemon listens on the default port 22.

If you want to change the default SSH port in Ubuntu, perform the following steps with root privileges:
- Open the /etc/ssh/sshd_config file and locate the line:
#Port 22
- Then, uncomment (Remove the leading # character) it and change the value with an appropriate port number (for example, 22000):
Port 22000
- Restart the SSH server:
systemctl restart sshd
After that, run the netstat command and make sure that the ssh daemon now listen on the new ssh port:
netstat -tulpn | grep ssh
When connecting to the server using the ssh command, you need to specify the port to connect using the -p flag:
ssh -p 22000 192.168.1.100
Note that if the Firewall is enabled, you need to add a rule to allow new SSH port.
Komentar
Posting Komentar