Difference between revisions of "SSH"

From VUB Hosting
Jump to: navigation, search
(Introduction)
Line 1: Line 1:
 
= SSH (EN) =
 
= SSH (EN) =
 
== Introduction ==
 
== Introduction ==
  +
  +
== Generate SSH key pair ==
  +
=== Linux ===
  +
=== Microsoft Windows ===
  +
'''Setting Up an SSH Session with SSH Keys in PuTTY'''
  +
<pre style="white-space: pre-wrap;
  +
white-space: -moz-pre-wrap;
  +
white-space: -pre-wrap;
  +
white-space: -o-pre-wrap;
  +
word-wrap: break-word;">
  +
When you recieve a confirmation from the hosting team that your public key has been added to your website on the webserver, we can use PuTTY (or whatever application that can use ssh with public keys) to connect to it. We will do this by setting up and saving a session. This way we will be able to quickly reconnect at a later time with all of our settings saved.
  +
  +
Open PuTTY and click on the plus sign of the "SSH" category in the navigation menu:
  +
</pre>
  +
  +
[[File:img1_ssh_tree_putty.png]]
  +
  +
<pre style="white-space: pre-wrap;
  +
white-space: -moz-pre-wrap;
  +
white-space: -pre-wrap;
  +
white-space: -o-pre-wrap;
  +
word-wrap: break-word;">
  +
Within this category, click on the "Auth" sub-category.
  +
There is a field on this screen asking for the "Private key file for authentication". Click on the "Browse" button:
  +
</pre>
  +
[[File:img2_ssh_menu_putty.png]]
  +
  +
<pre style="white-space: pre-wrap;
  +
white-space: -moz-pre-wrap;
  +
white-space: -pre-wrap;
  +
white-space: -o-pre-wrap;
  +
word-wrap: break-word;">
  +
Search for the private key file that you saved. This is the key that ends in ".ppk". Find it and select "Open" in the file window:
  +
</pre>
  +
[[File:img3_ssh_key_select.png]]
  +
  +
<pre style="white-space: pre-wrap;
  +
white-space: -moz-pre-wrap;
  +
white-space: -pre-wrap;
  +
white-space: -o-pre-wrap;
  +
word-wrap: break-word;">
  +
Next, in the Navigation menu, click on the plus sign of the “Connection” category. You will see a sub-menu with a sub-category “data”. Click on “Data” and then fill in the text box like here below.
  +
</pre>
  +
[[File:img4_ssh_login.png]]
  +
  +
<pre style="white-space: pre-wrap;
  +
white-space: -moz-pre-wrap;
  +
white-space: -pre-wrap;
  +
white-space: -o-pre-wrap;
  +
word-wrap: break-word;">
  +
The user to fill in is “<username>”
  +
</pre>
  +
[[File:img5_ssh_login_full.png]]
  +
  +
<pre style="white-space: pre-wrap;
  +
white-space: -moz-pre-wrap;
  +
white-space: -pre-wrap;
  +
white-space: -o-pre-wrap;
  +
word-wrap: break-word;">
  +
Now, in the navigation menu, we need to return to the "Session" category screen that we started at.
  +
This time, we need to create a name for the session that we will be saving. This can be anything, so select something that will help you remember what this is for.
  +
</pre>
  +
[[File:img6_ssh_client.png]]
  +
  +
<pre style="white-space: pre-wrap;
  +
white-space: -moz-pre-wrap;
  +
white-space: -pre-wrap;
  +
white-space: -o-pre-wrap;
  +
word-wrap: break-word;">
  +
When you are finished, click on the "Save" button.
  +
</pre>
  +
[[File:img7_ssh_client2.png]]
  +
  +
<pre style="white-space: pre-wrap;
  +
white-space: -moz-pre-wrap;
  +
white-space: -pre-wrap;
  +
white-space: -o-pre-wrap;
  +
word-wrap: break-word;">
  +
You now have saved all of the configuration data needed to connect to your new server.
  +
</pre>
  +
'''Connect to Your Server Using the Saved PuTTY Session'''
  +
<pre style="white-space: pre-wrap;
  +
white-space: -moz-pre-wrap;
  +
white-space: -pre-wrap;
  +
white-space: -o-pre-wrap;
  +
word-wrap: break-word;">
  +
Now that you have your session saved, you can recall these values at any time by returning to the "Session" screen, selecting the session you would like to use in the "Saved Sessions" section, and click "Load" to recall the settings.
  +
This will auto-fill all of the fields with the values you initially selected.
  +
When you are ready to actually connect to your server, on the "Sessions" screen, click the button at the bottom that says "Open" after you have loaded your session:
  +
</pre>
  +
[[File:img8_ssh_open.png]]
  +
  +
<pre style="white-space: pre-wrap;
  +
white-space: -moz-pre-wrap;
  +
white-space: -pre-wrap;
  +
white-space: -o-pre-wrap;
  +
word-wrap: break-word;">
  +
The first time that you connect with the remote host, you will be asked to verify the identity of the remote server. This is expected the first time you connect to a new server, so you can select "Yes" to continue.
  +
</pre>
  +
[[File:img9_ssh_warning.png]]
  +
  +
<pre style="white-space: pre-wrap;
  +
white-space: -moz-pre-wrap;
  +
white-space: -pre-wrap;
  +
white-space: -o-pre-wrap;
  +
word-wrap: break-word;">
  +
Afterwards, you should immediately be logged into your new server without ever having to type in a password
  +
If you've gotten this far, you've successfully configured SSH keys with your web server!
  +
</pre>
  +
 
= SSH (NL) =
 
= SSH (NL) =
 
== Inleiding ==
 
== Inleiding ==

Revision as of 09:23, 22 February 2018

SSH (EN)

Introduction

Generate SSH key pair

Linux

Microsoft Windows

Setting Up an SSH Session with SSH Keys in PuTTY

When you recieve a confirmation from the hosting team that your public key has been added to your website on the webserver, we can use PuTTY (or whatever application that can use ssh with public keys) to connect to it. We will do this by setting up and saving a session. This way we will be able to quickly reconnect at a later time with all of our settings saved.

Open PuTTY and click on the plus sign of the "SSH" category in the navigation menu:

Img1 ssh tree putty.png

Within this category, click on the "Auth" sub-category.
There is a field on this screen asking for the "Private key file for authentication". Click on the "Browse" button:

Img2 ssh menu putty.png

Search for the private key file that you saved. This is the key that ends in ".ppk". Find it and select "Open" in the file window:

Img3 ssh key select.png

Next, in the Navigation menu, click on the plus sign of the “Connection” category. You will see a sub-menu with a sub-category “data”. Click on “Data” and then fill in the text box like here below.

Img4 ssh login.png

The user to fill in is “<username>”

Img5 ssh login full.png

Now, in the navigation menu, we need to return to the "Session" category screen that we started at.
This time, we need to create a name for the session that we will be saving. This can be anything, so select something that will help you remember what this is for. 

Img6 ssh client.png

When you are finished, click on the "Save" button.

Img7 ssh client2.png

You now have saved all of the configuration data needed to connect to your new server.

Connect to Your Server Using the Saved PuTTY Session

Now that you have your session saved, you can recall these values at any time by returning to the "Session" screen, selecting the session you would like to use in the "Saved Sessions" section, and click "Load" to recall the settings.
This will auto-fill all of the fields with the values you initially selected.
When you are ready to actually connect to your server, on the "Sessions" screen, click the button at the bottom that says "Open" after you have loaded your session:

Img8 ssh open.png

The first time that you connect with the remote host, you will be asked to verify the identity of the remote server. This is expected the first time you connect to a new server, so you can select "Yes" to continue.

Img9 ssh warning.png

Afterwards, you should immediately be logged into your new server without ever having to type in a password
If you've gotten this far, you've successfully configured SSH keys with your web server!

SSH (NL)

Inleiding

SSH staat voor Secure Shell. Met SSH is het mogelijk een remote commandolijn te krijgen op onze webserver. SSH heeft tal van voordelen: het is licht in gebruik, ontworpen met veiligheid als belangrijkste vereiste, ondersteund op vele platformen, en een goed ingeburgerde manier om op afstand systemen te beheren.

SSH is voor u als hosting-gebruiker vooral nuttig indien u:

  • zelf cron jobs wil aanpassen
  • scripts hebt geschreven die bepaalde aspecten van uw site automatiseren
  • u met programma's als Drush of wp-cli wenst te werken
  • ...