Thursday, 13 October 2011

How to ssh in Linux and Windows


I am going to talk about how to ssh in Linux and in Windows. ssh is a tool for connecting to another computer (usually called a remote computer). For more information about ssh, go to http://en.wikipedia.org/wiki/Secure_Shell. I am currently using Ubuntu, but I am still a beginner terminal user. Ubuntu is really good for beginners like me because it provides a point and click interface so it is easy to use.

I am currently a research assistant under a business professor. The data I am dealing with is enormous and I need to estimate about 3200 parameters using MCMC. Unfortunately, I only have a laptop with 2 cores and 1 GB of memory. It is not a good idea to run such a huge job on my laptop. I need computing power to run my job! Fortunately, my supervisor has a remote computer which has 8 cores with 16 GB of memory and I can use his computer. That’s how I learnt ssh.

Linux
I am surprised that ssh in Linux is fairly simple. This is how to do it:
1. open the terminal (Ctrl + Alt + t)
2. write “ssh username@address -p port number”
ex) ssh jinny@xxxx.xxx.xx -p 0000
if there is no port, then just ignore the -p part
3. The password may be required.

That’s it. Now you are in the remote computer. It’s that simple!

Windows
For Windows, ssh is not provided so you should download it. You can download “PuTTy” here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

1. open PuTTY and press the run button (then you can see the PuTTY configuration)


2. type the host name in the Host Name section with the port number
3. select the connection type as SSH
4. click open

Now you are in the remote computer.

Once you ssh, you are in the Linux machine, so the following commands are used in a Linux setting.


DescriptionCommand line
change passwordpasswd
listls
create foldermkdir folder name (ex. mkdir Project)
change directorycd directory name  (ex. cd Project)
change to the parent directorycd ..
delete a filerm filename (ex. rm test.r)
delete a folderrm -r filename (ex. rm -r Project)
move filesmv (file you want to move) (to where)
copy filescp (file you want to move) (to where)



I did not write examples for move files and copy files because it requires some knowledge about relative paths and absolute paths. I will write about this concept in the next blog post.

2 comments:

  1. Jinney, how is your classwork? Have you taken Tom's class?
    by Hua

    ReplyDelete
  2. Hi Hua! Yes, I am taking Tom's class right now. Actually, it is very interesting and useful.

    ReplyDelete