LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   How Secure is SSH? (https://www.linuxquestions.org/questions/linux-security-4/how-secure-is-ssh-385411/)

AvatarofVirgo 11-22-2005 02:03 AM

How Secure is SSH?
 
I've allowed SSH through my firewall and nothing else. I'm also running SUSE 10. I was just wondering, how hard would it be for a remote user to crack SSH? I was debating blocking SSH as well.

And also, do I really need SSH and SMTP (postfix) for any thing? If not then I'll just turn those services off.

But my initial question for this thread is, how hard is it to crack SSH? I have no interest in cracking people's computers but I would be interested in learning how, for strictly educational purposes.

spooon 11-22-2005 03:56 AM

If you have accounts with common usernames and weak passwords, then it is easy to gain access by guessing. If you have strong passwords, it is very difficult to guess the password by brute force. I suggest you disallow root login via SSH, since root is often attacked, and root access can be otherwise gained after login to another account. For more security, you can disable password logins and instead use public keys (much more secure) to login from trusted computers.

Razze 11-22-2005 04:12 AM

From what I have understood SSH is as secure as the weakest user-password combination that is allowed to connect to the system. The SSH server itself should be more or less impossible to crack.

If you don't plan to access (or let anybody else for that matter) your system remotely you can shut down the SSH server.

doublejoon 11-22-2005 11:07 AM

Also if you are going to use SSH through the firewall

in your /etc/ssh/sshd_config file

Protocol 2
PermitRootLogin no


also maybe implement Private/Public RSA key Authentication for your ssh logins instead of using passwords

ssh

sundialsvcs 11-22-2005 11:23 AM

(1) If you don't have a clearly-defined need for ssh or any other service, turn the service off until you do.

(2) Functionally, ssh is still "a shell", and if you allow anyone to connect to it and demand from them no more than a simple username/password (as is the default), it's just as good to them as if they were using rsh or had walked into your office wearing an invisibility cloak.

(3) If you intend to use ssh to allow yourself remote access to your machine, always set it up to use digital certificates as the primary means of authentication. The documentation is plentiful and it's easy to do. Now, in order to even attempt to connect, the user is required to possess a valid certificate... which should be password protected. Users who cannot present that "identification badge" are turned away, having been given no opportunity to enter a password of any sort.

(3a) Digital certificates, used in this way, do not cost money: you generate them and sign them yourself.

(4) No one realistically breaks into a cryptosystem by brute-forcing the key. They attack the key-management system... or the lack thereof. Notice that, while SSH encrypts the traffic that it sends, it (by default) allows anyone, anywhere to "have a try at a user/pass," and if they guess right it lets them right in! But, if you use digital certificates, the strong cryptography is used twice: not only to encrypt the traffic, as before, but to provide an impregnable and irrefutable form of user authentication.

fotoguy 12-15-2005 04:10 AM

I wrote a little script that will generate the key for you then upload the key to the server you want just hit enter twice when it ask for a password. Once that is done it will ask for the password only for the first time you log in and after that it should not ask for a password. You may find this useful:

#!/bin/bash
USER="bill"
ADDRESS="xxx.xxx.xxx.xxx"
PORT="22"
NEWKEY="yes"

if [ $NEWKEY == "yes" ]; then
ssh-keygen -t dsa -f ~/.ssh/id_dsa
fi

cat ~/.ssh/id_dsa.pub | ssh -p $PORT $USER@$ADDRESS 'sh -c "cat - >>~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2"'

exit 0

Also need to allow in the sshd.conf on the server:

PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys2

nx5000 12-15-2005 07:01 AM

Quote:

Originally Posted by sundialsvcs
(1) If you don't have a clearly-defined need for ssh or any other service, turn the service off until you do.

Completely true. A lot of computers have been hacked by ssh.
Still remote computers need to have ssh enabled.
I know that some ISP use this:
http://www.hsc.fr/ressources/breves/secretssh.html.en

It's a bit security by obscurity but it always add a good layer for the script kiddiez

Sorry, it is not in english but perl code is international :)

ingram87 08-14-2011 08:11 AM

It's this easy...
 
If you don't have good security, then it is this easy to crack SSH:

[LINK REMOVED BY MODERATOR]

A simple and easy to use tutorial explaining how to crack SSH using Hydra on Ubuntu

win32sux 08-14-2011 12:37 PM

ingram87, re-read the LQ Rules. Providing assistance with cracking isn't allowed.


All times are GMT -5. The time now is 09:29 PM.