6 min read

With Ubuntu, sharing really is caring!

MTR

Mastering Ubuntu Server with  Jeremy 'Jay' LaCroix
Third Edition, out 10 November 2020 - get your copy now

Those who move in Open Source (OS) circles have come to regard Ubuntu as the world’s most popular OS Operating System for both development and deployment, from the data center, to the cloud, to the Internet of Things. Of course not all IT professionals would agree, so I asked a seasoned expert in the OS world, published author, and team member at Adaptavist, Jeremy 'Jay' LaCroix, why he believes Ubuntu is such a stand out IT platform, about his extensive experience in OS and the cloud, and what motivated him to write three books designed to help people master Ubuntu Server.

MR: Let me just dive right in Jay and ask what the book is about? 

JL: The book takes you through the process of setting up Ubuntu Server itself, or maybe just creating an EC2 instance in Amazon. I wanted to demonstrate that Ubuntu blends cutting edge tech with better stability than any distribution I know. If you have components that are too bleeding edge, your stability goes down, as you're using technologies perhaps yet unproven. In enterprise this has serious consequences, because if you have something recently released, say a week ago, and you're trying to use it on your production servers, it can be a disaster.

Also, if you want to learn about Linux in general, it takes you through everything. And if you're thinking about having a career in this, you'll have working examples around creating a load balanced web server on Amazon web services (AWS) with Autohealing, using Terraform to automate your stack and even using Ansible to do configuration management. There are lots of examples to help the reader get hands-on experience with the software. Get their feet wet. Living in it and doing the things they actually do in the real world, in a real job. This will allow them to understand how to do their job better. 

It's the book I wish I had read when entering the IT market. I always thought most IT books when I started were missing important things. For example, I've never read a book in IT that talked about version control like using Git. It surprises me as using Git for things outside of software development is huge. So I tried to make sure that the tools we actually use in the industry are given coverage in the book.

MR: Who would benefit from reading it?

JL: I would say both DevOps and system administration. The book covers automation in quite a lot of detail, so readers can learn how to automate an environment. It even has a chapter dedicated to AWS. This will really help DevOps. In the book I don't really make any claim as far as, you're going to have virtual servers, you're going to have physical servers. I try to make it as unbiased as I can. But I would say system administrators and DevOps are evenly served by the book, and maybe just those who want to learn Linux in general.

MR: After finishing the book, what would you hope will be the reader's key takeaways?

JL:  I want people to come away feeling Ubuntu is the best platform in the industry when it comes to enterprise Linux distributions. They created their own package management system with snap packages to try to make a distro-agnostic way of installing applications which are separate from the server's underlying package base, so users are less likely to encounter problems with stability. And they focus on the developer tooling more than any other distribution I know, to make it very easy for developers to get up to speed with the platform. I hope that once people have turned the last page there will be a far greater understanding of all of the moving parts and other things. I want people to say, "Oh, I can set up a load balancer and a bunch of servers behind it. It's not as hard as I thought."

MR: How are you going to bring that extensive knowledge in the book to bear in your new role at Adaptavist?

JL: One of the important things when it comes to server and infrastructure administration is automation. I feel like there's a lot of value I'll be adding there. In my role at Adaptavist, we're already discussing this, and finalising the outline for a new automation implementation. You can get too excited and develop something so quickly that nobody knows how to use it. It's all about getting everyone involved and saying, "hey let's automate this, but let's work together." It's about asking the questions, What makes your day hard? What do you find tedious? What takes up time? Let's automate those things, make them easier and less time consuming. Then you get the time back to do the value added things. 

To whet your appetite before release, here is a short excerpt from the book!

Creating and removing users

Creating users in Ubuntu can be done with one of two commands: adduser and useradd. This can be a little confusing at first, because both of these commands do the same thing (in different ways) and are named very similarly. I'll go over the useradd command first and then I'll explain how adduser differs. You may even prefer the latter, but we'll get to that in a moment.

Using useradd

First, here's an example of the useradd command in action:

With this command, I created a user named jdoe. With the -d option, I'm clarifying that I would like a home directory created for this user, and following that, I called out /home/jdoe as the user's home directory. The -m flag tells the system that I would like the home directory to be created during the process; otherwise, I would've had to create the directory myself. Finally, I called out the username for my new user (in this case, jdoe).

As we go along in this book, there will be commands that require root privileges in order to execute. The preceding command was an example of this. For commands that require such permissions, I'll prefix the commands with sudo. When you see these, it just means that root privileges are required to run the command. For these, you can also log in as root (if root is enabled) or switch to root to execute these commands as well. However, as I mentioned before, using sudo instead of using the root account is strongly encouraged.

Now, list the storage of /home using the following command:

You should see a folder listed there for our new user:

Figure 2.1: Listing the contents of /home after our first user was created

What about creating our user's password? We may have been asked for our current user's password due to using sudo, but we weren’t asked for a password for the new user. To create a password for the user, we can use the passwd command. The passwd command defaults to allowing you to change the password for the user you're currently logged in as, but it also allows you to set a password for any other user if you run it as root or with sudo. If you enter passwd by itself, the command will first ask you for your current password, then your new password, and then it will ask you to confirm your new password again. If you prefix the command with sudo and then specify a different user account, you can set the password for any user you wish. An example of the output of this process is as follows:

Figure 2.3: Creating a user with the adduser command

Want to find out more about the book and pre-order?

MR: Last but not least, where can readers get a copy of Mastering Ubuntu Server, or where can they go to learn more?

JL: You'll get all this information from ubuntuserverbook.com. I registered the domain, which directs to the Amazon page for it. You can pre-order there. I'll also be talking about the book on my YouTube channel, at LearnLinux.TV at some point. My Twitter feed will also be a good place, if you subscribe to @JayTheLinuxGuy on Twitter you'll get all the info you need there.


Stay up to date by signing up for monthly Adaptanews