Any good introduction for getting started with ssh on Ubuntu?

February 22, 2015 1.9k views

I am new to the linux OS and I am pretty excited about it as I have been learning new things almost every day.

The other day, I read about ssh but I couldn't find a good introductory tutorial on it!
Maybe I didn't pay a closer attention. But whatever the case.

What I wanted to do is

  • Write a shell script to open terminal on 2 PCs simultaneously (the other PC being the guest OS (ubuntu) running on my virtualbox).

How can I achieve this for a start?

Any suggestions or relevant links would be helpful guys :)

  • ssh is simply connecting to remote computer, and is fairly simple once you make connections a few times.

    It almost sounds like Bash Scripting is what you are really after, unless I am not understanding.

    Can you explain a little more what the first project is you want to do?

  • Hey, @sierracircle. Sorry if it was confusing.

    I will break it down.

    As I am just getting started, I am trying to open the terminal on my guest OS from the host OS ( which could be done through ssh if I am not wrong ).

    After that I would move on to connecting to other PC's on my network through ssh and then automate the opening of the terminal on them by running a bash script.

  • what is your guest OS?

  • I am running Ubuntu 14.04 as guest and 14.10 as host

  • Cool. That will make things easier for you (if you were using Windows you would have to work with Putty)

    Can we talk more about what you mean when you say "automate the opening of a terminal.."

    It is true that you can open a terminal on your home computer and type in something like:

    ssh youruser@yourremoteipordomain

    and that will log you in to your remote computer. From there you can run commands on your remote computer.

    Another thing you can do is write a bash script that automatically runs commands on your remote computer using terminal needed. You can just add a line to your bash script like:

    ssh youruser@yourremotecomputerordomain the command you want to run

    I would say the first thing you should get a grasp on is using ssh keys(if you have not already), as that will make the whole process much easier.
    Here is a tutorial for that:

    Also, I like to use the same username on my home computer that I use on my remote computers, so I can run ssh commands like this:

    ssh myremotecomputerip

    without having to add the mysuer@ since ssh will default to your current username if you do not put one there.

    SSH keys provide a more secure way of logging into a virtual private server with SSH than using a password alone. With SSH keys, users can log into a server without a password. This tutorial explains how to generate, use, and upload an SSH Key Pair.
Be the first one to answer this question.