42

I have a powerful computer in the lab and I installed Ubuntu 11.10 64-bit on it. I want to install an SSH server on it, so I can reach it from home and even from my Android via ssh. But I haven't got any experience on creating an ssh server.

The machine has a dynamic IP. I don't want any other ssh users, installing it only for myself will be enough for me.

Where should I start? What tools do I need and how would I configure them?

petrichor
  • 1,177

7 Answers7

40

To get started with ssh in general, install openssh-server.

sudo apt-get install openssh-server

On the next restart, this should start up automatically. To connect to the computer remotely, just enter the following in a remote terminal, substituting the ALL-CAPS names for your own:

ssh USERNAME@IPADDRESS

Now, to take care of the dynamic ip forcing you to recheck the IP all the time:

Get a free account on dyndns.com and choose the name you want to type when you connect.

Once that is done, install "ddclient" on the server machine. This will automatically update the IP address for you with dyndns.

sudo apt-get install ddclient

When you run it, it will ask you a series of questions, so have your username, password, and the URL you chose earlier ready to type in. It should also automatically add itself to startup.

That should be it. Now when you ssh, just use the URL you chose instead of your IPADDRESS since this should automatically update if the IP changes.

If you have a router, make sure to forward port 22 to your server! There are lots of guides on this at portforward.com for your specific router.

zookalicious
  • 2,303
4

You could get a hostname via a service like http://www.noip.com/ and then setup a ssh server. you would then connect via e.g.

ssh USERNAME@HOSTNAME.no-ip.biz
tpei
  • 458
3

check out this link:

http://www.raspberryanywhere.com/

Perhaps it can be of some help. I'v been using the service from several weeks and it works great!

The link provide a simple software teamviewer like to access your raspberry board anywhere you are. Furthermore, you can use your usual SSH client; they just provide a virtual address to connect to your board via SSH or HTTP . It worths a try for sure!

2

Installing and using ssh is easy. You can install it from here: https://apps.ubuntu.com/cat/applications/oneiric/openssh-server/.

Once it's installed, it'll run and run automatically at boot. All the users on the local machine will be able to use it. You'll still need to fix your network so you can connect to it, but that doesn't really have anything to do with ssh. If it has a public IP, then you can use something like dyndns.org and ddclient to get a dynamic name for it. If it doesn't have a public IP, then you'll also need to configure your network to forward traffic to it.

1

you can use SSH by using xmmpp / jabber protocol. so you can take access just by google talk on your desktop or mobile phone e.g android. No need IP Public No need special setting Just Install and run as a service. I made a script (tested on my raspian OS in Raspberry Pi) so u can easily install robotito. this is the steps 1. Open Shell Command or u can call it Terminal, go to your home folder, Download installer script by command : wget https://opengateway.googlecode.com/files/robotito it will save to you home folder ~ (e.g /home/pi)

  1. after that running the script by entering command : sudo ./robotito

  2. and then you can edit file credentials.rb in config folder if robotito using your gtalk account and save it by pressing ctrl+x and y . Default is using nano editor.

  3. running the robotito in robotito folder by command ./jabbershd start

  4. done you can use now from any google talk client, dont forget to add robotito gtalk account to your google talk account and test it with chatting each other before using the account.

awangga
  • 19
1

You need dynamic DNS client on your PC (or router) and optionally open port 22 on your router to the Ubuntu machine if PC is behind it. Then you can reach your machine via some custom name instead of IP.

Nobwyn
  • 161
0

I found that the tutorial described here:

https://www.howtogeek.com/devops/how-to-roll-your-own-dynamic-dns-with-aws-route-53/

Is the most straightforward method to setting up SSH with dynamic DNS. You still have to pay a little for your domain but since I already had an AWS account this felt like the easiest option.

jman
  • 185
  • 2
  • 8