User Management

SSH Login With Keys

From Your Computer

Make sure you have created a private/public key pair.  There are tons of articles online about how to use openSSH (for real operating systems) or some convoluted third-party app like Pagent or Putty to generate an SSH key.
Copy the contents of your file (you can use this public key on multiple services, BTW, they do not need to be unique per service.

On The Server

Login with your user account using an old-fashioned username/password.
Now let’s setup a way to login from your computer without typing passwords:

press i to enter insert mode
paste in the contents of that file you copied earlier
press <esc> to exit insert mode
type :wq! to quit vim
If the permissions of the .ssh directory and files within are not correct you cannot login.   chmod 777 (allow anyone to do anything) will not work as the SSH app checks for gaping security holes in file and directory permissions when authorizing access.

Creating Login Directories

As root type:

Useful if a user account was created without the “create login directory” option, which I always seem to forget.


SCP Files Between Servers

You’ll need an SSH username with password (or SSH pre-shared keys) on the target (remote) system.
Remember the default public key that will be sent is the ~/.ssh/ file on the current local system, so that content needs to be somewhere in the target system’s user .ssh/authorized_keys file.
From the server where the file resides.
scp <local_filename> <username>@<ip_address|domain>:<targetfile>

Share Your Insight

%d bloggers like this: