Make the sample "Add authorized key" button non-clickable.
[arvados.git] / doc / user / ssh-access.md
1 ---
2 layout: default
3 navsection: userguide
4 title: Setting up SSH access
5 navorder: 2
6 ---
7
8 # Setting up SSH access
9
10 Arvados uses SSH public key authentication for two things:
11
12 * logging in to a VM, and
13 * pushing code to a git repository.
14
15 ### Generate a public/private SSH key pair
16
17 If you don't already have an SSH key pair (or you don't know whether
18 you do), there are lots of tutorials out there to help you get
19 started:
20
21 * [github SSH key
22 tutorial](https://www.google.com/search?q=github+ssh+key+help)
23
24 ### Associate your SSH public key with your Arvados Workbench account
25
26 Go to the `Keys` page in Arvados Workbench (under the `Access` tab) and click the
27
28 <p style="margin-left: 4em"><span class="btn btn-primary disabled">Add a new authorized key</span></p>
29
30 button. Then click on 'none' in the public_key column, and copy and paste your public key:
31
32 ![Screen shot of the ssh public key box]({{ site.baseurl }}/images/ssh-adding-public-key.png)
33
34 Click on the checkmark button to save your public key.
35
36 ### Set up your ssh client (Unix-like systems only)
37
38 {% include notebox-begin.html %}
39
40 If you are using an Arvados site other than {{ site.arvados_api_host }}, replace "{{ site.arvados_api_host }}" with the appropriate Arvados API hostname in these examples.
41
42 {% include notebox-end.html %}
43
44 On your workstation, add the following section to your `~/.ssh/config`
45 file:
46
47     Host *.arvados
48       ProxyCommand ssh -p2222 turnout@switchyard.{{ site.arvados_api_host }} -x -a $SSH_PROXY_FLAGS %h
49
50 If you have access to an account `foo` on a VM called `blurfl` then
51 you can log in like this:
52
53     ssh foo@blurfl.arvados
54
55 Some other convenient configuration options are `User` and
56 `ForwardAgent`:
57
58     Host *.a
59       ProxyCommand ssh -p2222 turnout@switchyard.{{ site.arvados_api_host }} -x -a $SSH_PROXY_FLAGS %h
60       User foo
61           ForwardAgent yes
62
63 Adding `User foo` will log you in to the VM as user `foo` by default,
64 so you can just `ssh blurfl.a`. The `ForwardAgent yes` option turns on
65 the `ssh -A` option to forward your SSH credentials (if you are
66 using ssh-agent), which becomes important if you use git to
67 synchronize files between your workstation and the VM.
68
69 Then you can log in to the `blurfl` VM as `foo` like this:
70
71     ssh blurfl.a
72
73 Arvados Workbench will show you a list of VMs you have access to and
74 what your account name is for each one: click "VMs" in the "Access"
75 menu.
76
77 ### Windows: Setup instructions for PuTTY
78
79 PuTTY is a free (MIT-licensed) Win32 Telnet and SSH client. PuTTy includes all the tools a windows user needs to set up Private Keys and to set up and use SSH connections to your virtual machines in the Arvados Cloud. 
80
81 You can use PuTTY to create public/private keys, which are how you’ll ensure that that access to Arvados cloud is secure. You can also use PuTTY as an SSH client to access your virtual machine in an Arvados cloud and work with the Arvados Command Line Interface (CLI) client. 
82
83 PuTTY is an open source project and you download it [here](http://www.putty.org/).
84
85 Arvados uses Public-key encryption to secure access to your virtual machines in the Arvados cloud. this is a very standard approach. It’s secure, and easy to use. 
86
87 (Make sure to download the .zip file containing all the binaries, not each one individually)
88
89 __Step 1 - Adding PuTTY to the PATH__
90
91 1. After downloading PuTTY and unzipping it, you should have a PuTTY folder in C:\Program Files (x86)\ . If the folder is somewhere else, you can change the PATH in step X or move the folder to that directory.
92
93 2. In the Start menu, right click Windows and select Properties
94
95 3. Select Advanced System Settings, and choose Environment Variables
96
97 4. Under system variables, find and edit Path.
98
99 5. Add the following to the end of Path (make sure to include semi colon and quotation marks): 
100
101         ;\"C:\Program Files (x86)\PuTTY\"
102
103 6. Click through the OKs to close all the dialogs you’ve opened
104
105 __Step 2 - Creating a Public Key__
106
107 1. Open PuTTYgen from the Start Menu
108
109 2. At the bottom of the window, make sure the ‘Number of bits in a generated key’ field is set to 4096
110
111 3. Click Generate and follow the instructions to generate a key
112
113 4. Click to save the Public Key 
114
115 5. Click to save the Private Key (we recommend using a strong passphrase) 
116
117 6. Select the Public Key text in the box and copy (for next step) 
118
119 Now your key is successfully generated. 
120
121 __Step 3 - Load Your Public Key in to your Arvados Account through Workbench__
122
123 1. Open Workbench on the cloud where you have an arvados account
124
125 2. Go to Access > Keys in the menu 
126
127 3. Click to create a new key 
128
129 4. In the last column “public key” click on the text that says “none” and paste the public key from PuTTYgen into the box. 
130
131 Your public key is now registered with the Arvados cluster. 
132
133 __Step 4 - Set up Pageant__
134
135 1. Start Pageant from the PuTTY folder in the start menu 
136
137 2. Pageant will now be running in the system tray. Click the icon to configure. 
138
139 3. Choose Add Key and add the private which corresponds with the public key you loaded in your Arvados account through work bench. 
140
141 Pageant is now configured. It will run in the background as a system service. 
142
143 Note: Pageant is a PuTTY utility that manages private keys which makes repeatedly logging in through SSH less of a hassle. 
144
145 __Step 5 - Set up PuTTY__
146
147 1. Open PuTTY from the Start Menu
148
149 2. On the Session screen set the Host Name (or IP address) to “shell” 
150
151 3. On the Session screen set the Port to “22”
152  
153 4. On the Connection > Data screen set the Auto-login username to your VM’s Login,. You can find your login name in Workbench under Access > VMs last column on the table. 
154
155 5. On the Connection > Proxy screen set the Proxy Type to “Local” 
156
157 6. On the Connection > Proxy screen in the “Telnet command, or local proxy command” box enter “plink -P 2222 turnout@switchyard.qr1hi.arvadosapi.com %host”. Make sure you remove the “\n” from the end of the line.
158
159 7. Return to the Session screen. In the Saved Sessions box, enter a name for this configuration and hit Save. 
160
161
162 __Step 6 - Launch an SSH Session__
163
164 1. Open PuTTY 
165
166 2. Click on the Saved Session name you created in Step 5
167
168 3. Click Load to load those saved session settings
169
170 4. Click Open and that will open the SSH window at the command prompt. You will now be logged in to your virtual machine. 
171
172 _Note: We recommend you do not delete the “Default” Saved Session._
173