SSH

Asked by steve

Hi,

im new to Ubuntu game, can anyone tell me how i can set up my machine so it will allow incoming SSH connections?

also would i be able to connect to it from outside my LAN?

Ta

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu yelp Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Sebastien Estienne (sebest) said :
#1

i think that you just need to install the ssh server:
package: openssh-server

Revision history for this message
Sebastien Estienne (sebest) said :
#2

And yes you'll be able to connect from anywhere as long as your IP is reachable.

Revision history for this message
Sébastien Corriveau (sebcor-deactivatedaccount) said :
#3

As the previous poster says, you need to install the "openssh-server" package. Here's the command you need to type (in a terminal window) in order to do so (it may ask you for your password):

  sudo apt-get install openssh-server

Now you should be able to connect from anywhere UNLESS your computer is protected by a firewall or behing a NATting device (most home routers, like Linksys).

If your computer is behind a firewall (or have one installed into it) you need to permit incomming connections on port 22/tcp. See your firewall documentation for details.

If it is behind a NATting device, you also have to setup the "port forwarding" fonction on the device to redirect incomming connections for port 22/tcp. See your router documentation for details.

For better security, I suggest you take a look at the openssh server configuration file (/etc/ssh/sshd_config) and make sure their is the following line in it:

Protocol 2

Make sure it is not commented out (no "#" in front of it) and that it is not "Protocol 2,1". The ssh protocol 1 is vulnerable to a particular type of attack.

Finally, for even more security, I recommend using cryptographic keys for authentication instead of passwords. And if you do so, you can turn off password authentication with "PasswordAuthentication no" in the configuration file.

Can you help with this problem?

Provide an answer of your own, or ask steve for more information if necessary.

To post a message you must log in.