At times VPN can be such a monstrosity its not worth the overhead it ensues. I just need the comforting beacon of a command prompt and always there when you need it; SSH. The following are the steps I've taken to create a tranquil state of pragmatism.
Step 1: Create an account on the remote-host to be used to SSH with instead of root
# adduser [username]
Adding user `[username]' ...
Adding new group `[username]' (1000) ...
Adding new user `[username]' (1000) with group `[username]' ...
Creating home directory `/home/[username]' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: [Enter a password]
Retype new UNIX password: [Re-enter the same password]
passwd: password updated successfully
Changing the user information for [username]
Enter the new value, or press ENTER for the default
Full Name []: [Press enter key]
Room Number []: [Press enter key]
Work Phone []: [Press enter key]
Home Phone []: [Press enter key]
Other []: [Press enter key]
Is the information correct? [Y/n]:[Press enter key]
Step 2: Add the user into the sudo group on the remote-host
# usermod -aG sudo [username]
Step 3: If applicable, create public and private keys using ssh-keygen on the local-host
# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/to/[username]/.ssh/id_rsa):[Press enter key]
Enter passphrase (empty for no passphrase): [Press enter key]
Enter same passphrase again: [Press enter key]
Your identification has been saved in /to/[username]/.ssh/id_rsa.
Your public key has been saved in /to/[username]/.ssh/id_rsa.pub.
The key fingerprint is:
ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff root@local-host
Step 4: If applicable, install openssh-server, openssh-client and autossh on the local-host and remote-host
# apt-get install openssh-client openssh-server autossh
Step 5: Copy the public key to remote-host using ssh-copy-id
# ssh-copy-id [username]@[remote-host]
No comments:
Post a Comment