0

This question is about ssh

Hi i web server for my site, I use ssh :). I know i can port forward port 22 but is it safe enough? Let's say i use a password that takes a million years to crack or something. Will it be safe then or will someone be able to login with some trick?

Thanks

2

2 Answers 2

1

Use keys and disable password authentication. It will get rid of most of the authentication attempts and you are safe enough. SSH protocol itself is secure.

16
  • Huh so i have to disable it but i need the password right?
    – harry
    Jan 30, 2016 at 14:04
  • If you use keys, you don't need passwords.
    – Jakuje
    Jan 30, 2016 at 14:05
  • So that is way safer than a super complicated password?
    – harry
    Jan 30, 2016 at 14:06
  • Yes. Until the key is safe and/or protected by passhprase. You should be safe even with complicated password, but keys are preferred.
    – Jakuje
    Jan 30, 2016 at 14:18
  • 1
    You can also enable 2 factor authentication to further harden it.
    – user323419
    Jan 30, 2016 at 16:13
0

It is always a good idea to change de default port 22 to another one.

Under linux, edit this file /etc/ssh/sshd_config, change the port number by editing this line Port 22, save and restart SSH /etc/init.d/ssh restart

2
  • it is usually more complicated than above. It is "security through obscurity". If you are targeted by an attack, using nmap is matter of seconds to find your "safe" "another" port.
    – Jakuje
    Jan 30, 2016 at 16:15
  • @Jakuje: I'm not saying that changing SSH port is THE solution for maximum safety, just an additional method to avoid basic attacks.
    – David
    Jan 30, 2016 at 17:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .