11-01-2017, 01:25 PM
Hello,
I will tell you how to secure your vps ssh by changing port.
1st. Login with SSH (root)
2nd. Type this command
EX:
And press Enter to save the directory
And then type this command
Reply and rate!
I will tell you how to secure your vps ssh by changing port.
1st. Login with SSH (root)
2nd. Type this command
nano /etc/ssh/sshd_config
You will get this if you are using CentOSGNU nano 2.3.1 File: /etc/ssh/sshd_config
# $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32$
# This is the sshd server system-wide configuration fi$# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/usr$
# The strategy used for options in the default sshd_co$# OpenSSH is to specify options with their default val$# possible, but leave them commented. Uncommented opt$# default value.
# If you want to change the port on a SELinux system, $# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
[ Read 139 lines ]
^G Get He^O WriteO^R Read F^Y Prev P^K Cut Te^C Cur Pos^X Exit ^J Justif^W Where ^V Next P^U UnCut ^T To Spel
Changw the port line to # $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32$
# This is the sshd server system-wide configuration fi$# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/usr$
# The strategy used for options in the default sshd_co$# OpenSSH is to specify options with their default val$# possible, but leave them commented. Uncommented opt$# default value.
# If you want to change the port on a SELinux system, $# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
[ Read 139 lines ]
^G Get He^O WriteO^R Read F^Y Prev P^K Cut Te^C Cur Pos^X Exit ^J Justif^W Where ^V Next P^U UnCut ^T To Spel
Port 4/5NUMBERS HERE
And remove the #EX:
Port 9988
And then click CTRL + OAnd press Enter to save the directory
And then type this command
service sshd restart
And for Ubuntu do all of these steps but when you want to save doservice ssh restart
Now reboot or just exit from PuTTy and change the port to 9988 (the changed port) and re connect Reply and rate!