How to SSH to an IPv6 address from Linux

How to ssh to IPv6 address on Linux

IPv6, the newest network address standard for the whole internet, is becoming more widespread and will eventually replace IPv4 entirely. Sooner or later, network admins and computer hobbyists alike will find themselves interacting with IPv6 network addresses.

Simple tasks like using SSH to control a remote system will now change a little, so it’s important to relearn a few of the basics. In this guide, we’ll show how to SSH to an IPv6 address on a Linux system. These methods will work with all the most popular Linux distributions.

In this tutorial you will learn:

  • How to SSH to an IPv6 address on Linux
How to SSH to an IPv6 address from Linux

How to SSH to an IPv6 address from Linux

Read more

How to ping an IPv6 address from Linux

How to ping IPv6 address on Linux

Pinging network devices from a Linux system is a really common troubleshooting step for testing your internet connection or the connection to a particular device. If you’ve spent any time at all tinkering with computers and especially the Linux command line, you’re probably a little familiar with the ping command already.

What you may not be so familiar with is IPv6 addresses. IPv6 is intended to replace the IPv4 network address standard – an ongoing process that’s been years in the making. And although IPv4 shows no sign of going away right now, IPv6 network addresses are becoming more prevalent.

In this guide, we’ll show you how to ping an IPv6 address from a Linux system. This is one of the most fundamental troubleshooting steps, and it’s changing a little as the new standard becomes widespread. Various Linux distributions may treat the addresses differently, so let’s take a look at how we can ping IPv6 addresses from some of the most popular distros.

In this tutorial you will learn:

  • How to ping an IPv6 address on Linux
How to ping an IPv6 address from Linux

How to ping an IPv6 address from Linux

Read more

Netplan network configuration tutorial for beginners

Netplan network configuration tutorial for beginners

Netplan is an utility developed by Canonical, the company behind Ubuntu. It provides a network configuration abstraction over the currently supported two “backend” system, (or “renderer” in Netplan terminology): networkd and NetworkManager. Using Netplan, both physical and virtual network interfaces are configured via yaml files which are translated to configurations compatible with the selected backend.

On Ubuntu 20.04 Netplan replaces the traditional method of configuring network interfaces using the /etc/network/interfaces file; it aims to make things easier and more centralized (the old way of configuring interfaces can still be used: check our article about How to switch back networking to /etc/network/interfaces on Ubuntu 20.04 Focal Fossa Linux). In this article we will learn the basic principles behind the utility, and, just as an example, how we can use it to configure a static IPv4 address for a network interface.

In this tutorial you will learn:

  • The basic structure of yaml configuration files used by Netplan
  • How to create a simple rule to assign a static IP to a network interface
  • How to apply configurations using generate, try and apply subcommands

Read more

Raspberry Pi as a PXE boot server

How to configure a Raspberry Pi as a PXE boot server

PXE (Preboot eXecution Environment) is a client-server environment which makes possible to boot and install operating systems without the need of physical media. The core idea is quite simple: in a very early stage, a client gets an IP address from a DHCP server and downloads the files needed to perform the boot process via the tftp protocol (Trivial ftp). In this tutorial we will use the dnsmasq application: it can be used as a primary DHCP server or in proxy DHCP mode if another DHCP server exists in the network; it also provides the tftp service used to transfer files.

In this tutorial you will learn:

  • How to configure pxelinux and create a boot menu
  • How to extract files from an ISO and setup the appropriate file structure
  • How to configure dnsmasq as a standard or proxy DHCP server
  • How to configure the tftp server embed in dnsmasq
  • How to allow traffic through the needed ports using ufw

Read more

Changing SSH port on Linux

How to change SSH port on Linux

The default port for SSH on Linux systems is 22. There are a few reasons why you may want to change this to some other number. If multiple servers share the same IP address (behind a NAT configuration, for example) you usually can’t have them running SSH on the same port and expect to access them from outside the network.

The other big reason is security. Changing the SSH port would fall under “security through obscurity” which means that the security isn’t technically enhanced, but the SSH port has been obscured and isn’t as easy for attackers to access. In practice, this means that the thousands of bots scanning the internet for open SSH servers are a lot less likely to find yours.

In this article, we’ll take you through the step by step instructions of changing the default SSH port on Ubuntu Linux and CentOS Linux. Since Ubuntu is based on Debian, you can also apply the same instructions to other Debian based systems, like Linux Mint. CentOS is based on Red Hat, so its instructions can also be extended to Fedora and other similar Linux distributions.

In this tutorial you will learn:

  • How to change SSH port on Ubuntu and CentOS Linux

Read more

How to monitor network activity on a Linux system

How to monitor network activity on a Linux system

There are many reasons why you may want to monitor the network activity on your Linux system. You may be troubleshooting a network issue, you may want to check to make sure that there are no malicious applications creating suspicious network activity, or you may simply want to know if any processes are phoning home. Whatever the reason, here are a few methods to see which processes on your system are engaged in network activity and who they are communicating with.

Read more

ss command on Linux

Using ss command on Linux

The ss command is the successor to the netstat command on Linux systems. The command is used by system administrators to see information about network connections. It allows you to check things like the status, origin, and destination of connections. In addition, ss displays route tables, interface statistics, masquerade connections, and multicast memberships.

In this guide, you’ll learn how to use the ss command through examples and explanations. We’ll show you its most common uses and everything you need to know in order to use it effectively.

In this tutorial you will learn:

  • How to use ss command

Read more

Redirect HTTP traffic to HTTPS in Apache

How to use Apache to redirect all traffic from http to https

If your website uses Apache and SSL, there’s not much reason to keep using HTTP with your website. Having both HTTP and HTTPS just creates duplicate content, as now any given page will be accessible through two technically different URLs.

In this guide, we’ll assume you’re already using Apache on a Linux system and want to redirect all HTTP traffic to HTTPS. This will make sure that all your visitors are only connecting through HTTPS by forcing their browser over to the secure protocol if they happen to open an HTTP link. If a user decides to preface a link with http://, your site will be smart enough to still send them to the correct page, rather than showing duplicate content or displaying a 404 error.

There are two ways to set up this redirection in Apache. The better method is to configure Virtual Host, but users with hosted websites may not have access to this configuration. The second method is by making some changes to the .htaccess file. We’ll cover the step by step instructions for both methods below. Let’s get started.

In this tutorial you will learn:

  • How to redirect HTTP to HTTPS with Virtual Host
  • How to redirect HTTP to HTTPS with .htaccess file

Read more

Redirect HTTP traffic to HTTPS in NGINX

How to use Nginx to redirect all traffic from http to https

If your website is hosted with NGINX and it has SSL enabled, it’s best practice to disable HTTP completely and force all incoming traffic over to the HTTPS version of the website. This avoids having duplicate content and ensures that all of the site’s users are only browsing the secure version of your website. You should also see an SEO boost, as search engines prefer non-redundant and secured web pages.

In this guide, we’ll assume you’re already using NGINX on a Linux system and want to redirect all HTTP traffic to HTTPS. Even if a user happens to follow an http:// link, the site should send them to the correct and secured page, which happens instantly and without the user’s intervention.

There are two ways to setup this redirection in NGINX. One method allows you to configure the redirection for individual sites. The other method can redirect HTTP to HTTPS for all NGINX sites on your server, which is handy if you have multiple sites setup and want to avoid having to apply the exact same redirection to each one. We’ll cover the step by step instructions for both methods below. Let’s get started.

NOTE
Using Apache instead of NGINX? We’ve written a separate guide for how to use Apache to redirect all HTTP traffic to HTTPS.

In this tutorial you will learn:

  • How to redirect HTTP to HTTPS for individual NGINX websites
  • How to redirect HTTP to HTTPS for all NGINX websites

Read more

Tips & Tricks with Netcat command on Linux

Tips & Tricks with Netcat command on Linux

Netcat is a versatile networking utility which can be used for reading from and writing to TCP and UDP connections on arbitrary ports (as with other utilities used on Linux, ports below 1024 require root/sudo privileges). By default netcat uses TCP connections, but UDP can be specified with the -u flag. Netcat can be used as both a server and a client. When used as a server the -l flag is used to listen for a connection. Similar to the cat command, netcat can receive information from stdin and write to stdout making it great for workflows involving pipes and redirects. The nc command is typically used to evoke netcat for ease of use.

Read more

GNU/Linux General Troubleshooting Guide for Beginners

GNU/Linux General Troubleshooting Guide for Beginners

In this guide, our goal is to learn about the tools and environment provided by a typical GNU/Linux system to be able to start troubleshooting even on an unknown machine. In this tutorial you will learn:

  • How to check disk space
  • How to check memory size
  • How to check system load
  • How to find and kill system processes
  • How to user logs to find relevant system troubleshooting information

Read more