Using SSH to Manage Your EVBackup Accounts
This page covers a variety of commands revolving around the Secure Shell (SSH). SSH is the best way to login and manage your Open Remote Backup Account.
SSH Clients and Logging In
To use SSH, you'll need an SSH client:
- Unix, Linux, BSD, MacOS X, and other *nix
-
If you're using a flavor of *nix that was installed within the last 10 years or so,
chances are you have an SSH client. You need only to open a terminal and login.
- Show me more »
- « OK. Hide this
To check to if you have an SSH client, open a terminal and enter the following:If a path is returned, then you are good to go. If not, just let us know:which ssh - MS Windows
-
Windows doesn't have a native SSH client, so you'll need to download and install one.
- Show me some options »
- « OK. Hide this
- Grysnc for Windows
-
The great thing about Grsync for Windows is that it gives you all of the tools you'll need
to get the most from your EVBackup account. Not only do you get a great graphical rsync client,
you also get
ssh-keygenandssh-- just as if you were using a Unix system. -
To enable ssh access directly from the command line, you'll need to add Grsync's bin directory
to the Windows path. In a command prompt window, enter the following:
set PATH=%programfiles%\grsync\bin;%PATH% -
Download Grsync for Windows »
EVBackup Grsync for Windows tutorial » - PuTTY
-
PuTTY is a very commonly used SSH client for Windows. What's neat about PuTTY is that there
really is no installation: just download the executables. There are two notable differences between
PuTTY and a Unix system.
First, the command used to invoke an SSH session is different. Instead of:
...you'll enter:ssh user@user.evbackup.comSecond, the SSH keys generated by PuTTYgen are not compatible with our system. Unfortunately, PuTTYgen cannot produce RFC 4716 compliant keys at this time. However, Pageant (PuTTY's SSH agent) is capable of importing RFC 4716 compliant keys. Therefore, if someone has created a keypair for you then PuTTY is a great choice.putty user@user.evbackup.com -
To enable access to PuTTY directly from the command line, you'll need to add PuTTY's directory
to the Windows path. Assuming you've downloaded the PuTTY executables to c:\program files\putty,
In a command prompt window, enter the following:
set PATH=%programfiles%\putty;%PATH% - Download PuTTY »
Opening a Terminals in Windows and Mac
To open a terminal (command prompt) in Windows:
- Open the Run prompt by holding down the Window key on your keyboard and pressing R.
- In the run box, enter CMD and click the OK button.
To open a terminal in Mac:
- Open Finder
- Click: Applications > Utilities > Terminal.
Creating an SSH Keypair with ssh-keygen
This step is optional: if you want to connect to your space without having to enter a password, or you want to script SSH commands, you should setup a keypair.
Notes:- Each of the following commands are entered as a single line.
-
You'll want to run all of the commands here as the 'super-user' (using
sudo), so that you have full access to all the files on your machine.
- 1. Create an SSH key pair with ssh-keygen
-
Note the command ends with two single quote characters.
sudo ssh-keygen -f /backup/ssh_key -t rsa -N ''
- Why do I need an SSH keypair? »
- « OK. Hide this
An SSH key pair allows you to securely login to your backup server without entering a password each time.
- 2. Upload and activate the public key to your EVBackup account
-
sudo rsync -e ssh /backup/ssh_key.pub user@user.evbackup.com:ssh_keys/key1.pubssh user@user.evbackup.com addkeysShow Me
- Notes about uploading »
- « OK. Hide this
- Substitute
userwith your EVBackup account name. - When you enter this command, you might see a message indicating that your computer is doesn't recognize the server. Just enter yes when prompted and you'll never be bothered again.
- You'll be asked to enter the password for your EVBackup account. Once the key is uploaded and activated, this won't be necessary again.
- If Terminal simply returns (looking as though nothing has happened), then you have successfully uploaded your key!
- 3. Test that you can login without a password
-
sudo ssh -i /backup/ssh_key user@user.evbackup.com- How do I know if it worked? »
- « OK. Hide this
If you were successful, then something very similar to the following will appear in Terminal:
Last login: Thu Jul 15 16:16:44 2010 from c-28-26-13-101.
Copyright (c) 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 6.4-STABLE (EXAVAULT) #1:
[your-account@quark ~]$
Invoking an SSH Session
To start an SSH session, open a terminal and enter the following:
ssh user@user.evbackup.comTo open an SSH session without being prompted for a password:
ssh -i /path/to/private/key user@user.evbackup.comTo run a command on the remote server with SSH:
ssh user@user.evbackup.com [command] [command-args]To redirect the results of a command from the remote server to a file (e.g. a log):
ssh user@user.evbackup.com [command] [command-args] >> /local/fileTo navigate to a remote directory when you log in to the remote server:
ssh user@user.evbackup.com cd remote/directoryCommon Account Management Tasks
Here are some of the more common tasks that you can do with your EVBackup account.
To check your account quota:
ssh -i /path/to/private/key user@user.evbackup.com du -shTo obtain a list of the directory sizes on your account:
ssh -i /path/to/private/key user@user.evbackup.com du -hd1To obtain an MD5 checksum of a file on your account:
ssh -i /path/to/private/key user@user.evbackup.com md5 [remote-file]To obtain a recursive directory listing — with human readable file sizes, group / owner lists, file timestamps, and hidden files shown:
ssh -i /path/to/private/key user@user.evbackup.com ls -AlhpRTo obtain the current time from the EV server (GMT):
ssh -i /path/to/private/key user@user.evbackup.com dateTo zip up a directory on your account:
ssh user@user.evbackup.com tar -cvzf zip-file.tgz directory/to/zip