Skip to content

Helps you create your own remote web development environment.

License

Notifications You must be signed in to change notification settings

napjoseph/remote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 

Repository files navigation

remote

Helps you create your own remote web development environment using Linode.

Installs

Pre-requisities

Generate SSH Key for your local machine

Follow GitHub's guide to generate your SSH key pair. For Windows users, you may need to check this guide from Microsoft to enable SSH in your machine.

Afterwards, add the key to your GitHub and Linode account.

Generate SSH Key for your new Linode instance

Create a new SSH Key for your new Linode instance. Save this for now as we'll use this later.

Generate GPG Key

Follow this guide to generate a GPG key using Keybase.

NOTE: For Windows, if you already installed the Keybase app, you should have the CLI app will be ready to use (no need to install via brew).

Again, you need to add this key to your GitHub account.

Creating your server instance using Linode's StackScripts

  • Open the StackScripts page and click Create StackScript.
  • Copy the contents of web.sh. This will only work on Debian 10.
  • Click Deploy New Linode.
  • Fill out the fields and then click Create Linode.
  • Wait for your instance to be provisioned.
  • If all goes well, the status will change to Running and you can then connect to your instance.

Connecting via SSH

Start the ssh-agent in the background:

# linux/macos

$ eval `ssh-agent -s`
> Agent pid 59566
# windows

Start-Service ssh-agent

Add your SSH private key to the ssh-agent. If you created your key with a different name, or if you are adding an existing key that has a different name, replace id_ed25519 in the command with the name of your private key file.

ssh-add ~/.ssh/id_ed25519

Then connect via SSH:

ssh <NON_ROOT_USERNAME>@<LINODE_IPV4_ADDRESS> -p <SSH_PORT>

Alternatively, you can create a config file to make it easier to connect to your remote host.

# ~/.ssh/config

Host <ALIAS>
  User <NON_ROOT_USERNAME>
  HostName <LINODE_IPV4_ADDRESS>
  Port <SSH_PORT>
  IdentityFile <PRIVATE_KEY_FILE_LOCATION>
ssh <ALIAS>

Congratulations! You can now connect to your remote server instance.

NOTE: You can already connect via SSH even if the StackScript has not yet been completed. To check its status, you can check the logs using cat /var/log/stackscript.log.

Additional setup

The essentials are already installed in your instance. However, we need to configure a few applications we will use.

Configuring your zsh theme

IMPORTANT: You also need to install the recommended fonts for the theme to display properly.

IMPORTANT: If you are using Windows, you can use Windows Terminal. You can check my current settings for Windows Terminal.

If you enabled UPGRADE_SHELL_EXPERIENCE, zsh, oh-my-zsh, and the powerlevel10k zsh theme will be installed.

On your first login via SSH, it will ask you to configure your theme. To run the wizard again, you can run:

p10k configure

Fixing your SSH Private Key

Due to StackScripts not yet having a multiple-line UDF, the line breaks for our private key was removed.

Update the .ssh/$HOSTNAME with the correct version.

Configure Keybase

# login
keybase login

# check if you have more than one key saved
keybase pgp export

# if yes, specify the id in the commands below
# keybase pgp export -q 31DBBB1F6949DA68 | gpg --import

# import public key
keybase pgp export | gpg --import

# import private key
keybase pgp export --secret | gpg --allow-secret-key-import --import

# check imported key
gpg --list-secret-keys --keyid-format LONG
# /Users/pstadler/.gnupg/secring.gpg
# ----------------------------------
# pub   2048R/DEADBEEF 2012-08-16
# uid                  Name (Comment) <[email protected]>
# sub   2048R/86D2FAC6 2012-08-16

Notice the hash DEADBEEF. We will use this in the next section.

Configure Git

# add your basic information
git config --global user.name "Your Name"
git config --global user.email "[email protected]"

# sign all commits using your GPG key
git config --global user.signingkey DEADBEEF
git config --global commit.gpgsign true

About

Helps you create your own remote web development environment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages