{"id":26045173,"url":"https://github.com/powerappsdarren/linux-server-notes","last_synced_at":"2025-07-29T05:04:59.035Z","repository":{"id":279889520,"uuid":"940310530","full_name":"PowerAppsDarren/Linux-Server-Notes","owner":"PowerAppsDarren","description":"My notes for setting up my Linux servers","archived":false,"fork":false,"pushed_at":"2025-06-27T11:58:22.000Z","size":653,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-11T20:02:08.851Z","etag":null,"topics":["linux","linux-setup"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PowerAppsDarren.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-28T00:42:02.000Z","updated_at":"2025-06-27T11:58:25.000Z","dependencies_parsed_at":"2025-02-28T10:15:48.884Z","dependency_job_id":"a52f4be7-ec64-4031-b6ea-7bf353484c72","html_url":"https://github.com/PowerAppsDarren/Linux-Server-Notes","commit_stats":null,"previous_names":["powerappsdarren/linux-server-notes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PowerAppsDarren/Linux-Server-Notes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerAppsDarren%2FLinux-Server-Notes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerAppsDarren%2FLinux-Server-Notes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerAppsDarren%2FLinux-Server-Notes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerAppsDarren%2FLinux-Server-Notes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PowerAppsDarren","download_url":"https://codeload.github.com/PowerAppsDarren/Linux-Server-Notes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerAppsDarren%2FLinux-Server-Notes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267632859,"owners_count":24118749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux","linux-setup"],"created_at":"2025-03-07T19:32:23.175Z","updated_at":"2025-07-29T05:04:59.027Z","avatar_url":"https://github.com/PowerAppsDarren.png","language":"HTML","readme":"# Linux Server Setup \u0026 Configuration\r\n\r\nHere are all the steps I use to set up a Linux server. I use Ubuntu Server LTS, but these steps should work for most Linux server.\r\n\r\n\u003e**DISCLAIMER:** This guide is intended for educational purposes only. Use at your own risk. I am not responsible for any damage or loss of data that may occur as a result of following this guide.\r\n\r\n## Linux Server Setup \u0026 Configuration\r\n\r\n- [Step #1: Get a Server](get-a-server-now.md)\r\n- [Step #2: Obtain Vital Information](#step-2-obtain-vital-information)\r\n- [Step #3: Download \u0026 Install Putty](#step-3-download--install-putty)\r\n- [Step #4: Login to Server](#step-4-login-to-server)\r\n- [Step #5: Update System Packages](#step-5-update-system-packages)\r\n- [Step #6: Create a New User](#step-6-create-a-new-user)\r\n- [Step #7: Verify New User](#step-7-verify-new-user)\r\n- [Step #8: Configure SSH Security](#step-8-configure-ssh-security)\r\n- [Installing a Desktop Environment](#installing-a-desktop-environment)\r\n\r\n## Step #1: Get a Server \r\n\r\nGet your server from a hosting provider. I personally use and recommend [Hostinger](https://hostinger.com). \r\n\r\n## Step #2: Obtain Vital Information\r\n\r\nOnce you have your server, you will need to obtain the following information:\r\n\r\n- **Root Password**: You will need the root password to login to your server. Chances are, you were prompted to create one. You should have received this in an email from your hosting provider. If you didn't, check your hosting provider's documentation on how to obtain it.\r\n\r\n- **Server IP Address**: This is the public IP address of your server. You will use this to connect to your server.\r\n\r\n## Step #3: Download \u0026 Install Putty\r\n\r\n- Download Putty from [here](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)\r\n- Install Putty on your local machine\r\n- Open Putty and enter your server IP address in the Host Name field\r\n- Enter 22 in the Port field\r\n- Select SSH as the Connection Type\r\n- Click Open\r\n\r\n## Step #4: Login to Server\r\n\r\n```bash\r\nroot@your-server-ip\r\npw: your-server-password\r\n```\r\n## Step #5: Update System Packages\r\n\r\nFirst, update your system to ensure you have the latest security patches:\r\n\r\n```bash\r\nsudo apt update \u0026\u0026 sudo apt upgrade -y\r\n```\r\n\r\n\u003e Note: The `-y` flag is used to automatically answer yes to all prompts.\r\n\r\n## Step #6: Create a New User\r\n\r\nCreate a New User with Administrative Privileges\r\nCreate a non-root user with sudo privileges:\r\n\r\n\u003e Originally, sudo stood for \"superuser do,\" as it was initially designed to allow users to run commands with superuser (root) privileges. This remains its most common interpretation and usage in everyday discussions. \u003cbr\u003e\u003cbr\u003eHowever, the official Sudo project has moved away from this definition. According to the project's website, sudo now means \"su 'do'\" which suggests a tool that delivers su-like capabilities.\r\n\r\n```bash\r\nsudo adduser your__user__name\r\nsudo usermod -aG sudo your__user__name\r\n```\r\n\r\n\u003e The -aG option combines two separate flags that work together to add a user to a supplementary group without removing them from any existing groups.\r\n\u003cbr\u003e\u003cbr\u003eThe -a flag stands for \"append\" and must be used together with the -G option. It ensures that the user is added to the specified group(s) while preserving their existing group memberships.\r\n\u003cbr\u003e\u003cbr\u003eThe -G flag specifies the supplementary group(s) that the user should be added to. In this case, the group is also named \"sudo\".\r\n\u003cbr\u003e\u003cbr\u003eWithout the -a flag, using just -G would replace all of the user's existing supplementary group memberships with only the groups specified in the command. This could potentially remove the user from important groups and cause problems with their account permissions.\r\n\u003cbr\u003e\u003cbr\u003eSo in this specific example, sudo usermod -aG sudo yourusername safely adds \"yourusername\" to the \"sudo\" group, which grants them administrative privileges through the sudo command, while maintaining all their current group memberships.\r\n\r\n## Step #7: Verify New User\r\n\r\nYou can verify that your user exists by running:\r\n\r\n```bash\r\nid yourusername\r\n# or\r\ngroups yourusername\r\n# or \r\nid -nG yourusername\r\n# or\r\nsudo whoami\r\n```\r\n\r\n## Step #8: Configure SSH Security\r\n  \r\nEdit the SSH configuration file:\r\n\r\n```\r\nsudo nano /etc/ssh/sshd_config\r\n```\r\n\r\n### Make these security-focused changes:\r\n\r\n- Disable root login: PermitRootLogin no\r\n- Change default SSH port (optional): Port 2222 (choose a port between 1024-65535)\r\n- Allow only your new user: AllowUsers yourusername\r\n\r\n- Disable password authentication (after setting up SSH keys)   \r\n    - PasswordAuthentication no\r\n\r\n### Set maximum authentication attempts: MaxAuthTries 3\r\n\r\nSet up SSH key authentication (on your local machine):\r\n\r\nInstalling a Desktop Environment\r\nUbuntu Server doesn't come with a GUI by default, so you'll need to install one:\r\n\r\nsudo apt update\r\nsudo apt upgrade -y\r\nsudo apt install ubuntu-desktop -y\r\n\r\nsudo apt-get install net-tools\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerappsdarren%2Flinux-server-notes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpowerappsdarren%2Flinux-server-notes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerappsdarren%2Flinux-server-notes/lists"}