Results 1 to 3 of 3

Thread: using openssh over internet setup?

  1. #1
    Join Date
    Dec 2011
    Location
    Kalamazoo, Michigan
    Beans
    88
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    using openssh over internet setup?

    I was wondering if someone could supply me with a tutorial on how to remotely connect to my sever using openssh. I have an openssh client on the client computer, can someone help me?


    Thanks,
    TJ

  2. #2
    pricetech is offline Iced Blended Vanilla Crème Ubuntu
    Join Date
    Apr 2008
    Beans
    1,651

    Re: using openssh over internet setup?

    A few issues first;

    Do you have a fixed IP address ?? If not, do you have some kind of dynamic DNS account that will allow you to point to your IP by name ??

    You'll need to configure your router to forward port 22, or whatever port you decide to use for SSH, to the internal IP of your server. Have you done this yet ??

    I suggest installing fail2ban on the server to help protect you from attempts to break in to your server.

    Have you completely set up the server and tested it internally ??

    What you're wanting to do is pretty common, so you shouldn't have any trouble finding information on the subject, but I suggest starting with the points mentioned above and go from there.

  3. #3
    Join Date
    Dec 2010
    Beans
    573
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: using openssh over internet setup?

    First I would suggest not using port 22 on the external NAT/Firewall rule. When I was using port 22 I got hundreds of bruit force attacks a day. Select an alternate port.

    Also I limit the number of allowed connections with iptables from external. The easiest way to do this is to have sshd listen on two ports. This minimizes the how many connections a hacker can make slowing down any bruit force attack.

    Lets say the second port is 23456 in your iptables rules add something like this:
    Code:
    -A Firewall-1-INPUT -p tcp --dport 23456 -m recent --set --name ssh2 --rsource
    -A Firewall-1-INPUT -p tcp --dport 23456 -m recent ! --rcheck --seconds 60 --hitcount 4 --name ssh2 --rsource -j ACCEPT
    This allows 4 connections to this alternate port in 60 seconds.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •