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:

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.

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

A Simple Introduction to Cisco CML2

0 3640 0

Mark Jacob, Cisco Instructor, presents an introduction to Cisco Modeling Labs 2.0 or CML2.0, an upgrade to Cisco’s VIRL Personal Edition. Mark demonstrates Terminal Emulator access to console, as well as console access from within the CML2.0 product. Hello, I’m Mark Jacob, a Cisco Instructor and Network Instructor at Interface Technical Training. I’ve been using … Continue reading A Simple Introduction to Cisco CML2

Cable Testers and How to Use them in Network Environments

0 645 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

OSPF Adjacency Troubleshooting Solution – Getting Close to the OSPF adj

0 246 1

In this video, Cisco CCNA & CCNP instructor Mark Jacob shows how to troubleshoot OSPF Adjacency issues by showing the distance between routers with the show ip ospf neighbor command.

Write a Comment

See what people are saying...

    Share your thoughts...

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