Joyent

 

SSH Guide

SSH (Secure SHell) - Securely log a user into a remote system and run commands on that system.

Preflight Checklist

This guide assumes little prior knowledge about SSH. This will cover a few commands involved once you have connected via SSH. This is all about using the SSH tools. Stay tuned for a more comprehensive guide to command line tools under Solaris.

What is this SSH business anyway?

Maybe you’ve used SSH before, maybe you haven’t. If you haven’t SSH is an incredibly useful tool that allows you to perform a lot of functions on a remote server. Some examples might be uploading files to a server. Or going in and quickly editing a file on the server. Even executing commands and running applications on the remote server.

SSH is a secure replacement for telnet and rsh. It allows secure encrypted remote shell access and secure ftp access. These are typically referred to as SSH and SFTP respectively. Joyent enables SSH access by default. So once you have your login, password and server name you can login using the SSH tools if you have them installed. OS X and most Linux systems have SSH installed out of the box and there are various utilities for Windows.

Logging In

Logging into your server is as simple as typing the following command in your favorite terminal application (like Terminal.app, eterm, xterm, Command Prompt, etc).

 ssh username@server.joyent.us

It will then prompt you for your password. Type it in and press enter. It will not display the characters in your password, it remains blank. So just keep typing and hit enter when finished.

You’ll be prompted with the following line:

 [z030230:~] username$ 

The first part, the z030230 part is your zone name. Each accelerator has its own zone. The ~ part located after the colon means you’re in the current users home directory. Finally, it tells you the username you are currently logged in as. The $ signifies the end of the information and that you can start typing in commands that allow you to manipulate files and execute programs. This will be covered more in-depth in another guide.

To exit from that SSH connection, simply type exit and you will drop back to your own machines command line.

Using SFTP

Using scp

Not only can you copy files onto a remote machine with sftp, but there’s another program designed specifically for quickly copying files called scp.

To copy a file to a remote machine. You need to merely type:

 scp filename username@server.joyent.us:filename

Now, this needs explanation. I think most of it makes sense up until the :filename part. The colon (:) represents the break in between the server and the remote location. If you want to upload the file to your home directory, merely use :. at the end. If you want to rename it differently than the current filename, use :newfilename or if you want to copy it to another directory, just use :directory/.

Generating SSH Keys

Using ssh-agent to manage passphrases

SSH Tunneling

config file

So who wants to type ssh abcdefaa@abcdefaa.joyent.us all of the time. You are able to use the ssh config file to define all kinds of shortcuts. You are able to specify the ssh key file to present and make an easy to remember name for it all. This is the simple case, your username is the same, use the default key pair (or none at all)

On your *local* machine create a ~/.ssh/config file (don’t forget to set the correct file permissions (700))

Host web1
HostName example.com

Here is the more complex want to login as a different user and use a different ssh key pair:

Host web2
HostName example.com
IdentityFile ~/.ssh/web-rsa-2048
User linda

You are able to have as many host definitions as you would like in that file. Then to use it you simply use this:

ssh web1
 
all-accelerators/kb/ssh/start.txt · Last modified: 2008/05/23 13:04 by lderezinski
 
Recent changes RSS feed Creative Commons License Driven by DokuWiki