{"id":517,"date":"2024-10-19T08:41:06","date_gmt":"2024-10-19T08:41:06","guid":{"rendered":"https:\/\/cpanelwebhosting.co.in\/articles\/?p=517"},"modified":"2024-10-19T08:43:52","modified_gmt":"2024-10-19T08:43:52","slug":"basic-setup-of-ubuntu-22-04-os","status":"publish","type":"post","link":"https:\/\/cpanelwebhosting.co.in\/articles\/basic-setup-of-ubuntu-22-04-os\/","title":{"rendered":"Basic Setup of Ubuntu 22.04 OS via SSH: A Comprehensive Guide"},"content":{"rendered":"\n<p>Ubuntu 22.04 is a powerful and stable version of the Linux operating system, ideal for both servers and desktop environments. For <a href=\"https:\/\/cpanelwebhosting.co.in\/cpanel-vps-hosting\/\" rel=\"nofollow\">server management<\/a>, SSH (Secure Shell) is commonly used to access and control remote servers. After installing Ubuntu 22.04 on a server, it\u2019s essential to perform some basic setup tasks to ensure the system is secure, up-to-date, and configured correctly.<\/p>\n\n\n\n<p>This guide will walk you through the basic setup of Ubuntu 22.04 OS via SSH.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#prerequisites\">Prerequisites<\/a><\/li><li><a href=\"#step-1-connecting-to-your-ubuntu-22-04-server-via-ssh\">Step 1: Connecting to Your Ubuntu 22.04 Server via SSH<\/a><ul><li><a href=\"#connecting-from-linux-mac-terminal\">Connecting from Linux\/Mac Terminal<\/a><\/li><li><a href=\"#connecting-from-windows-using-pu-tty\">Connecting from Windows Using PuTTY<\/a><\/li><\/ul><\/li><li><a href=\"#step-2-update-and-upgrade-the-system\">Step 2: Update and Upgrade the System<\/a><\/li><li><a href=\"#step-3-set-the-timezone\">Step 3: Set the Timezone<\/a><\/li><li><a href=\"#step-4-update-your-ssh-client-configuration\">Step 4: Update Your SSH Client Configuration<\/a><\/li><li><a href=\"#step-5-reboot-the-server-optional\">Step 5: Reboot the Server (Optional)<\/a><\/li><li><a href=\"#conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h2>\n\n\n\n<p>Before starting, you need:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Access to the server with Ubuntu 22.04 installed.<\/li>\n\n\n\n<li>SSH access to the server (usually done via <a href=\"https:\/\/cpanelwebhosting.co.in\/cpanel-dedicated-server\/\" rel=\"nofollow\">terminal on Linux<\/a>\/Mac or using an SSH client like PuTTY on Windows).<\/li>\n\n\n\n<li>A stable internet connection.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-1-connecting-to-your-ubuntu-22-04-server-via-ssh\">Step 1: Connecting to Your Ubuntu 22.04 Server via SSH<\/h2>\n\n\n\n<p>To connect to your Ubuntu server, you need the server\u2019s IP address and SSH credentials (username and password or private key).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"connecting-from-linux-mac-terminal\">Connecting from Linux\/Mac Terminal<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open a terminal window.<\/li>\n\n\n\n<li>Use the following command to connect via SSH:<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">ssh username@server_ip_address <\/mark><br>Replace username with your actual username on the server and server_ip_address with the IP address of the server.<\/li>\n\n\n\n<li>Enter your password or the private key to log in.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"connecting-from-windows-using-pu-tty\">Connecting from Windows Using PuTTY<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"593\" height=\"537\" src=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/putty-configuration-in-ubuntu-22.04.png\" alt=\"putty configuration in ubuntu 22.04\" class=\"wp-image-526\" style=\"width:458px;height:auto\" srcset=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/putty-configuration-in-ubuntu-22.04.png 593w, https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/putty-configuration-in-ubuntu-22.04-300x272.png 300w\" sizes=\"(max-width: 593px) 100vw, 593px\" \/><\/figure><\/div>\n\n\n<ol class=\"wp-block-list\">\n<li>Download and install PuTTY.<\/li>\n\n\n\n<li>Open <a href=\"https:\/\/www.putty.org\/\" rel=\"nofollow noopener\" target=\"_blank\">PuTTY<\/a> and enter the server IP address.<\/li>\n\n\n\n<li>Click <strong>Open<\/strong> and log in using your username and password.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-2-update-and-upgrade-the-system\">Step 2: Update and Upgrade the System<\/h2>\n\n\n\n<p>After logging in via SSH, the first thing you should do is update the package lists and upgrade the system to ensure that all software is up-to-date.<\/p>\n\n\n\n<p>Update the package lists:<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">sudo apt update<\/mark><\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"312\" src=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/ubuntu-update.png\" alt=\"ubuntu update\" class=\"wp-image-524\" style=\"width:512px;height:auto\" srcset=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/ubuntu-update.png 712w, https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/ubuntu-update-300x131.png 300w\" sizes=\"(max-width: 712px) 100vw, 712px\" \/><\/figure><\/div>\n\n\n<p>Upgrade the installed packages:<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">sudo apt upgrade -y<\/mark><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"822\" height=\"192\" src=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/ubuntu-setup-upgrade.png\" alt=\"ubuntu 22.04 setup upgrade\" class=\"wp-image-523\" style=\"width:698px;height:auto\" srcset=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/ubuntu-setup-upgrade.png 822w, https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/ubuntu-setup-upgrade-300x70.png 300w, https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/ubuntu-setup-upgrade-768x179.png 768w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"851\" height=\"227\" src=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/ubuntu-upgrade-continue.png\" alt=\"ubuntu upgrade - continue\" class=\"wp-image-525\" style=\"width:750px;height:auto\" srcset=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/ubuntu-upgrade-continue.png 851w, https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/ubuntu-upgrade-continue-300x80.png 300w, https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/ubuntu-upgrade-continue-768x205.png 768w\" sizes=\"(max-width: 851px) 100vw, 851px\" \/><\/figure><\/div>\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<p>This command will upgrade all installed packages to the latest available versions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-3-set-the-timezone\">Step 3: Set the Timezone<\/h2>\n\n\n\n<p>Setting the correct timezone ensures accurate log timestamps and scheduling.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Check the current timezone:<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">timedatectl<\/mark><\/li>\n\n\n\n<li>To change the timezone, use the following command:<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">sudo timedatectl set-timezone Region\/City<\/mark> <br>Replace <code>Region\/City<\/code> with your desired location, for example:<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">sudo timedatectl set-timezone Asia\/Kolkata<\/mark><\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"286\" src=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/set-time-zone-.png\" alt=\"set time zone\" class=\"wp-image-522\" style=\"width:480px;height:auto\" srcset=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/set-time-zone-.png 730w, https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/set-time-zone--300x118.png 300w\" sizes=\"(max-width: 730px) 100vw, 730px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"step-4-update-your-ssh-client-configuration\">Step 4: Update Your SSH Client Configuration<\/h2>\n\n\n\n<p>If you frequently connect to the server, you can configure your SSH client to use the new port automatically.<\/p>\n\n\n\n<p>Edit the SSH client configuration file:<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">nano \/etc\/ssh\/sshd_config<\/mark><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"507\" height=\"112\" src=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/change-the-port-number.png\" alt=\"change the port number\" class=\"wp-image-518\" style=\"width:661px;height:auto\" srcset=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/change-the-port-number.png 507w, https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/change-the-port-number-300x66.png 300w\" sizes=\"(max-width: 507px) 100vw, 507px\" \/><\/figure><\/div>\n\n\n<p>Add the following lines to specify the <a href=\"https:\/\/cpanelwebhosting.co.in\/cpanel-dedicated-server\/\" rel=\"nofollow\">new port for your server<\/a>:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"813\" src=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/port-changed-22-to-2244-1024x813.png\" alt=\"port changed 22 to 2244\" class=\"wp-image-519\" style=\"width:571px;height:auto\" srcset=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/port-changed-22-to-2244-1024x813.png 1024w, https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/port-changed-22-to-2244-300x238.png 300w, https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/port-changed-22-to-2244-768x610.png 768w, https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/port-changed-22-to-2244.png 1129w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Include \/etc\/ssh\/sshd_config.d\/*.conf<br><br>Port 2244<br>AddressFamily any<br>ListenAddress 0.0.0.0<br>ListenAddress ::<\/mark><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"587\" height=\"138\" src=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/restart-the-SSH.png\" alt=\"restart the SSH\" class=\"wp-image-521\" srcset=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/restart-the-SSH.png 587w, https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/restart-the-SSH-300x71.png 300w\" sizes=\"(max-width: 587px) 100vw, 587px\" \/><\/figure><\/div>\n\n\n<p>Save and exit. After you can restart the sshd service. Now, whenever you connect to this server, it will automatically use the new port.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-5-reboot-the-server-optional\">Step 5: Reboot the Server (Optional)<\/h2>\n\n\n\n<p>After performing the above steps, you might want to reboot the server to ensure all configurations are properly applied.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"522\" height=\"117\" src=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/reboot-the-server.png\" alt=\"reboot the server\" class=\"wp-image-520\" style=\"width:683px;height:auto\" srcset=\"https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/reboot-the-server.png 522w, https:\/\/cpanelwebhosting.co.in\/articles\/wp-content\/uploads\/2024\/10\/reboot-the-server-300x67.png 300w\" sizes=\"(max-width: 522px) 100vw, 522px\" \/><\/figure><\/div>\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">reboot<\/mark><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>Setting up a basic <a href=\"https:\/\/ubuntu.com\/\" rel=\"nofollow noopener\" target=\"_blank\">Ubuntu 22.04<\/a> server via SSH is essential for ensuring the server\u2019s security and performance. By updating the system, creating a non-root user, securing SSH, enabling the firewall, and installing necessary packages, you\u2019ll have a robust and secure server ready for <a href=\"https:\/\/cpanelwebhosting.co.in\/cpanel-webhosting\/\" rel=\"nofollow\">hosting applications<\/a>.<\/p>\n\n\n\n<p>Following this guide will ensure your Ubuntu 22.04 server is correctly configured and ready for production use. Always remember to maintain regular security checks, backups, and software updates to keep your server running smoothly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu 22.04 is a powerful and stable version of the Linux operating system, ideal for both servers and desktop environments. For server management, SSH (Secure Shell) is commonly used to&hellip;<\/p>\n","protected":false},"author":5,"featured_media":527,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-517","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/cpanelwebhosting.co.in\/articles\/wp-json\/wp\/v2\/posts\/517"}],"collection":[{"href":"https:\/\/cpanelwebhosting.co.in\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelwebhosting.co.in\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelwebhosting.co.in\/articles\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelwebhosting.co.in\/articles\/wp-json\/wp\/v2\/comments?post=517"}],"version-history":[{"count":2,"href":"https:\/\/cpanelwebhosting.co.in\/articles\/wp-json\/wp\/v2\/posts\/517\/revisions"}],"predecessor-version":[{"id":529,"href":"https:\/\/cpanelwebhosting.co.in\/articles\/wp-json\/wp\/v2\/posts\/517\/revisions\/529"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cpanelwebhosting.co.in\/articles\/wp-json\/wp\/v2\/media\/527"}],"wp:attachment":[{"href":"https:\/\/cpanelwebhosting.co.in\/articles\/wp-json\/wp\/v2\/media?parent=517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelwebhosting.co.in\/articles\/wp-json\/wp\/v2\/categories?post=517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelwebhosting.co.in\/articles\/wp-json\/wp\/v2\/tags?post=517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}