Performing Root Tasks as a Non-Root User in Kali Linux

Home > Blogs > Security > Performing Root Tasks as a Non-Root User in Kali Linux

Performing Root Tasks as a Non-Root User in Kali Linux

Like This Blog 0Mike Danseglio
Added by March 14, 2016

Kali Linux is a fantastic operating system for penetration testing and security evaluation. It comes with virtually all security tools built in, it’s lightweight by default, and it has a huge ecosystem that is constantly helping with the project.

For instructor-led Security training see our course schedule

I created a new installation of Kali Linux recently. One of the first post-installation tasks I did was to create a new user for daily use. Running as root all the time is a horrible security practice, so I recommend that you create a new user as soon as possible after installation.

However, root privileges are required for many tasks in Kali. For example, running apt-get to update software fails as a non-root user:

001-running-apt-get-in-Kali-Linux

A little trick is helpful here. The su command is a Linux command that temporarily switches the context of Terminal commands into the root user. This means that new commands issued after typing su (and providing the password for root) are executed as root.

You may also like:  The Importance of Updating Kali Linux Rolling Distribution

To do this, just type in su and press enter. You’ll be prompted for the password.

002-Root-Tasks-as-a-Non-Root-User-in-Kali-Linux

Notice the prompt has changed from user@machine to root@machine. That’s the reminder that you’re now executing commands as root. This allows me to complete the earlier operation successfully, as shown here.

003-successfully-running-Root-Tasks-as-a-Non-Root-User-in-Kali-Linux

Now you can execute multiple root commands while remaining logged in as a non-root user.

Enjoy!

More Kali Linux Blogs:
How to Create a Bootable USB Installation for Kali Linux

Here’s how you can make your own bootable Kali Linux installer on USB

Adding a New Non-Root User in Kali Linux

 

Mike Danseglio – CISSP, MCSE, and CEH

Mike Danseglio teaches IT Security Training, Windows, System Center and Windows Server 2012 classes at Interface Technical Training. His classes are available in Phoenix, AZ and online with RemoteLive™.

Videos You May Like

Agile Methodology in Project Management

0 73 0

In this video, you will gain an understanding of Agile and Scrum Master Certification terminologies and concepts to help you make better decisions in your Project Management capabilities. Whether you’re a developer looking to obtain an Agile or Scrum Master Certification, or you’re a Project Manager/Product Owner who is attempting to get your product or … Continue reading Agile Methodology in Project Management

Creating Users and Managing Passwords in Microsoft Office 365

0 165 1

In this Office 365 training video, instructor Spike Xavier demonstrates how to create users and manage passwords in Office 365.

Detailed Forensic Investigation of Malware Infections – April 21, 2015

2 268 3

In this IT Security training video, Security expert Mike Danseglio (CISSP / CEH) will perform several malware investigations including rootkits, botnets, viruses, and browser toolbars.

Write a Comment

Share your thoughts...

Please fill out the comment form below to post a reply.