Ubuntu Post-Install

As soon as your chosen Linux flavor is installed, its best to do some things immediately. My approach is a mix of Ubuntu’s installation tutorial, Ubuntu’s desktop guide, and Network Chuck’s YouTube videos. By no means are these steps my own. Here we go. 

  1. Install updates 
  2. User control 
  3. Set up Linux’s ufw

Installing updates

Installing updates was the easiest task to complete. It had the least amount of steps and was super simple.

  • Launch CLI (CLI, CL, or whatever lingo you use; I use CLI for shorthand of command line interface).
    1. Sudo apt update 
    2. Sudo apt upgrade -y
    3. sudo snap refresh 

User Control 

Before jumping into syntax, let’s go over a few things. We want to allow sudo permissions to yourself to avoid using root privileges. Creating the first user will automatically be assigned as the root use and a super user. Just by not using root privileges can prevent accidental mistakes such as fat fingered syntax executed under the root access.  Here is a small knowledge bomb directly from the Ubuntu guide…

“Ubuntu developers made a conscientious decision to disable the administrative root account by default in all Ubuntu installations. This does not mean that the root account has been deleted or that it may not be accessed. It merely has been given a password hash which matches no possible value, therefore may not log in directly by itself. Instead, users are encouraged to make use of a tool by the name of ‘sudo’ to carry out system administrative duties. Sudo allows an authorized user to temporarily elevate their privileges using their own password instead of having to know the password belonging to the root account. This simple yet effective methodology provides accountability for all user actions, and gives the administrator granular control over which actions a user can perform with said privileges.”

I tried to add my new user name as sudo user but could not because my default user did not have administrative rights. I misunderstood or misread because I thought I read that the default user had administrative rights but I was wrong. This brought me back to the Ubuntu Desktop Guide here —> https://help.ubuntu.com/stable/ubuntu-help/user-admin-change.html.en. It actually does say “The first user account on the system is usually the one that has administrator privileges. This is the user account that was created when you first installed the system.” Usually was not in my case but its okay we will move forward. Below are the steps from the desktop guide. 

  1. Open the Activities overview and start typing Users.
  2. Click Users to open the panel.
  3. Press Unlock in the top right corner and type in your password when prompted.
  4. Under Other Users, select the user whose privileges you want to change.
  5. Set the Administrator switch to on.
  6. The user’s privileges will be changed when they next log in.

Now that our account has administrative rights, let’s add a new user and allow super user access so we don’t have to use root access. NOTE: There are several ways to execute one thing. I tried to list a few variations. 

  • Add user
    • sudo adduser <username> 
    • sudo adduser starlx EXAMPLE
  • Create a new group
    • sudo groupadd <groupname> 
    • sudo groupadd sudousergroup EXAMPLE
  • Add the new user to the new group
    • usermod -a -G (or -aG) examplegroup exampleusername
    • usermod -aG sudousergroup starlx  EXAMPLE
      • a  append
      • g gid GROUP (primary group)
      • G groups GROUPS (supplementary group)
  • View group (to verify the new user is listed) in several different ways
    • cat /etc/group (list ALL groups made)
    • getent group (list all groups available to the current user)
    • getent group | <groupname> (list specific group name)
    • getent group | sudousergroup EXAMPLE
    • egrep -i “^groupname” /etc/group

Did you accidentally add a user or group you want to delete? 

  • Delete user
    • sudo userdel <username>
    • sudo userdel starlx EXAMPLE
    • sudo userdel -r <username>
    • sudo userdel -r starlx   EXAMPLE
      • r (searches file sys associated with user to delete)

I needed to delete a group because I made two similar groups. 1. Sudousergroup and 2. superusergroup but I only want one to identify sudo group usernames. 

  • Delete group
    • sudo groupdel <groupname>
    • sudo groupdel sudousergroup EXAMLE

After running groupdel sudousergroup, I ran getent group | sudousergroup to verify the group was in fact deleted. Success!

Want to view groups another user is assigned to? Don’t forget to use sudo! I have been typing sudo so far in every command but to save time and space I’m going to stop. If you are ever prompted access denied or no privileges, you probably need to add in sudo. 

  • groups <username> 

Rabbit hole side ADD note… what’s the difference in grep v egrep? Ill come back to this question at a later time.

Other taskings that could be categorized under user control are disabling the guest account and changing default credentials. 

TO BE CONTINUED…

  1. Install updates 
  2. User control 
  3. Set up Linux’s ufw

Resources

Ubuntu Desktop Guides https://help.ubuntu.com/lts/ubuntu-help/index.html

Ubuntu Security https://ubuntu.com/server/docs/security-users

Disable Guest Account https://itsfoss.com/disable-guest-account-session-ubuntu-1304/

List of Ubuntu articles & tutorials https://itsfoss.com/tag/ubuntu/

Network Chuck’s 5 Steps to Secure Linux (protect from hackers)

**************************************************************************

Rabbit hole side ADD note… what’s the difference in grep v egrep? Ill come back to this question at a later time. Adding to the list of things to do.

abolishing the situation of oppression activism affordances a priori authenticity Blogs cause of liberation critical thinking cyborgs disability disaffordances and dysaffordances DuckDuckGo emergent bias engagement entry-level FOSS How Cybersecurity Really Works impacts of technology infosec matrix of domination microaggressions mobilization niche (niches) novice open source paradigm shift pedagogy phenomenon pioneering Podcast praxis preexisting bias Security Best Practices social impacts StationX systematic exclusion technical bias The CISO Series transformation true dialogue TWiT universal design user-centered design (USD) user privilege value-sensitive design (VSD)


Posted

in

by

Tags: