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 1 Mike 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:


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.

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


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.


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


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

Cable Testers and How to Use them in Network Environments

0 580 1

This content is from our CompTIA Network + Video Certification Training Course. Start training today! In this video, CompTIA Network + instructor Rick Trader demonstrates how to use cable testers in network environments. Let’s look at some tools that we can use to test our different cables in our environment. Cable Testers Properly Wired Connectivity … Continue reading Cable Testers and How to Use them in Network Environments

Agile Methodology in Project Management

0 185 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 809 5

In this Office 365 training video, instructor Spike Xavier demonstrates how to create users and manage passwords in Office 365.   For instructor-led Office 365 training classes, see our course schedulle: Spike Xavier SharePoint Instructor – Interface Technical Training Phoenix, AZ 20347: Enabling and Managing Office 365    

Write a Comment

See what people are saying...

    Share your thoughts...

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