{"id":537,"date":"2024-09-04T08:34:22","date_gmt":"2024-09-04T06:34:22","guid":{"rendered":"http:\/\/wordpress.xoupix.fr\/?p=537"},"modified":"2024-09-04T08:34:23","modified_gmt":"2024-09-04T06:34:23","slug":"new-server-primary-configuration","status":"publish","type":"post","link":"https:\/\/blog.xoupix.fr\/index.php\/2024\/09\/04\/new-server-primary-configuration\/","title":{"rendered":"New server primary configuration"},"content":{"rendered":"\n<p>Here is what to know about new server configuration.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Server update<\/h2>\n\n\n\n<p>As root, run the following commands to get your server up to date:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ubuntu@mylinuxserver:~# sudo apt update\nubuntu@mylinuxserver:~# sudo apt upgrade<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Fail2Ban installation<\/h2>\n\n\n\n<p>Fail2Ban will check periodically logs to detect unsuccessful connections and ban them by adding rules on firewall. On Ubuntu, install it using the following command lines:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ubuntu@mylinuxserver:~# sudo apt install fail2ban\nubuntu@mylinuxserver:~# sudo systemctl status fail2ban<\/code><\/pre>\n\n\n\n<p>Fail2Ban must be active (running) and enabled.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Enabling TCP forwarding<\/h2>\n\n\n\n<p>TCP forwarding is usefull to set up SSH tunnels. To enable it on Ubuntu, edit the \/etc\/ssh\/sshd_config or create a new file \/etc\/ssh\/sshd_config.d\/ with .conf extension and enable the AllowTcpForwarding yes property. Restart your system after that.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install Docker<\/h2>\n\n\n\n<p>As I use Docker to deploy my private services (as this blog), I need to install Docker on the new system. Here is how to proceed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ubuntu@mylinuxserver:~# sudo apt-get update\nubuntu@mylinuxserver:~# sudo apt-get install ca-certificates curl\nubuntu@mylinuxserver:~# sudo install -m 0755 -d \/etc\/apt\/keyrings\nubuntu@mylinuxserver:~# sudo curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg -o \/etc\/apt\/keyrings\/docker.asc\nubuntu@mylinuxserver:~# sudo chmod a+r \/etc\/apt\/keyrings\/docker.asc\nubuntu@mylinuxserver:~# echo   \"deb &#91;arch=$(dpkg --print-architecture) signed-by=\/etc\/apt\/keyrings\/docker.asc] https:\/\/download.docker.com\/linux\/ubuntu \\\n  $(. \/etc\/os-release &amp;&amp; echo \"$VERSION_CODENAME\") stable\" |   sudo tee \/etc\/apt\/sources.list.d\/docker.list > \/dev\/null\nubuntu@mylinuxserver:~# sudo apt-get update\nubuntu@mylinuxserver:~# sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin\nubuntu@mylinuxserver:~# sudo sudo usermod -aG docker ${USER}\n\n<\/code><\/pre>\n\n\n\n<p>At this time, reconnect to your server to be view as part of docker group, and try to execute a simple docker container:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ubuntu@mylinuxserver:~# docker run hello-world<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is what to know about new server configuration.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-537","post","type-post","status-publish","format-standard","hentry","category-non-classe"],"_links":{"self":[{"href":"https:\/\/blog.xoupix.fr\/index.php\/wp-json\/wp\/v2\/posts\/537","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.xoupix.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.xoupix.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.xoupix.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.xoupix.fr\/index.php\/wp-json\/wp\/v2\/comments?post=537"}],"version-history":[{"count":2,"href":"https:\/\/blog.xoupix.fr\/index.php\/wp-json\/wp\/v2\/posts\/537\/revisions"}],"predecessor-version":[{"id":539,"href":"https:\/\/blog.xoupix.fr\/index.php\/wp-json\/wp\/v2\/posts\/537\/revisions\/539"}],"wp:attachment":[{"href":"https:\/\/blog.xoupix.fr\/index.php\/wp-json\/wp\/v2\/media?parent=537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.xoupix.fr\/index.php\/wp-json\/wp\/v2\/categories?post=537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.xoupix.fr\/index.php\/wp-json\/wp\/v2\/tags?post=537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}