This guide will show you how to prepare your Ubuntu server for development by setting up secure access with SSH keys, modifying your SSH configuration for enhanced security, and installing necessary packages through a script.
After completing this guide, you'll be able to:
- Securely log into your server using SSH keys.
- Configure your SSH settings for improved security.
- Install essential packages on your server using a script.
- Introduction
- Prerequisites
- Step 1 - Generating and Setting Up SSH Keys
- Step 2 - Adjusting Your SSH Settings for Security
- Step 3 - Installing Packages with a Script
- Conclusion
Before starting, you need:
- An Ubuntu server with root access.
- A computer with SSH client software.
Create a secure SSH key pair on your computer:
ssh-keygen -t rsa -b 4096
Copy your public SSH key to your clipboard for easy access:
cat ~/.ssh/id_rsa.pub | pbcopy
Log into your server as the root user:
ssh root@{{ip_address}}
Set up the .ssh
directory and secure it:
mkdir -p ~/.ssh && chmod 700 ~/.ssh
Paste your SSH key into the authorized_keys
file:
vim ~/.ssh/authorized_keys
Then secure the file:
chmod 600 ~/.ssh/authorized_keys
Important: Before proceeding, test your SSH key by logging in from another terminal tab or session to ensure you don’t lose access.
ssh root@{{ip_address}}
Once you’ve successfully logged in via SSH key, you can further enhance your SSH login security by modifying a couple of settings:
Open the SSH configuration file:
vim /etc/ssh/sshd_config
Include these lines to disable password authentication and deny empty passwords:
PasswordAuthentication no
PermitEmptyPasswords no
Save your changes and exit the editor.
Apply your new SSH configuration by restarting the service:
systemctl restart ssh
In your Ubuntu server, run the following script to install necessary packages. This script fetches and applies an installation script directly:
curl -sSL https://raw.githubusercontent.com/MurmurationsNetwork/MurmurationsServices/main/scripts/ubuntu_setup.sh | bash
Your Ubuntu server is now set up with enhanced security measures and ready for development. You've implemented SSH key access, updated SSH configurations for improved security, and installed important packages.
Go to Section 2 - Setting up K3s.