Accessing servers remotely

From Richmond Maker Labs
Revision as of 13:43, 10 January 2019 by Beardedfool (talk | contribs)
Jump to navigation Jump to search

New servers, new method of entry. This page may disappear once you're in.

To start

 ssh USERNAME@littlehouse.richmondmakerlabs.uk - p 47938

-p is the port number.

As usual, change your password with

 passwd

Why not the standard port 22?

  • A lot of people do this for security through security through obfuscation.
  • Personally it just because it lessens the amounts of scans we get and makes it easier to log at logs

I've failed and can't log in

  • Wait 10 minutes and try again. Or contact Andy

Public keys

We're going to move to using public keys and, once yours are set up, I'll disable password entry.

On your computer, you need to do this once.

 ssh-keygen -t ed25519 -a 100

Name it something useful (rml-entry works with the config file later) and put a password on it. This stops it being used if somehow lost/ taken

Generating public/private ed25519 key pair.
Enter file in which to save the key (C:\Users\andy/.ssh/id_ed25519): rml-entry
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in rml-entry.
Your public key has been saved in rml-entry.pub.
The key fingerprint is:
SHA256:UBa3EOvvnuxyWCuticQ51O0FriJ+2/x9KOOmO593les andy@BEAST
The key's randomart image is:
+--[ED25519 256]--+
|        *o.      |
|       o + .     |
|      . . o      |
|       + o .     |
|      . S o .   .|
|     o . +..   ..|
|    . * .+o. . ..|
|   . o.*=+B+o o. |
|    ..o.B/@+.o.E |
+----[SHA256]-----+

Getting key onto server

Now the key is created we need to add it to your account

 ssh-copy-id USERNAME@littlehouse.richmondmakerlabs.uk -p 47983 -i ~/.ssh/rml-entry

You can test this at this stage by

 ssh USERNAME@littlehouse.richmondmakerlabs.uk -p 47938 -i ~/.ssh/rml-entry

Success is you getting in without having to enter your password.

I can't remember that!

You probably don't need to if you're largely using the same computer. Look for a .ssh folder and create (or add) the following entry to a file called config, changing the username to your one and the identity file to whatever you called the key you created.

 Host rml-entry
   HostName littlehouse.richmondmakerlabs.uk
   Port 47983
   User YOURUSERNAME
 IdentityFile ~/.ssh/rml_entry_key

Once that's done you can just do

 ssh rml-entry 

You'll still need your password when using sudo of course.