SSoL–Elevating Privileges

I don’t think most of us need to know Linux, but if you end up managing a system, it’s good to have a little idea of how to get around. This is a short series of posts as I remember the skills I used to have back in university.

One of the things that you might find the need to do on a Linux system is elevate your privileges. By default when we connect and work on Linux, we are working as normal users. We do this in Windows, but when we need more privileges, Windows will give us a UAC prompt. Linux doesn’t.

For example, when I want to check for updates of software, I use apt-get. That doesn’t work for my normal user:

2017-06-15 09_54_59-Ubuntu 64-bit SQL Server .210 - VMware Workstation

Instead I need to use sudo to elevate privileges. You prefix a command with sudo, enter the root password, and you get elevated privileges, as shown here.

2017-06-15 09_57_14-Ubuntu 64-bit SQL Server .210 - VMware Workstation

If you just enter sudo -i, then you get the shell to switch and all commands execute as root.

2017-06-15 10_00_09-Ubuntu 64-bit SQL Server .210 - VMware Workstation

Don’t do this. DON’T. Work as a normal user until you need higher privileges. For the most part you don’t.

About way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , . Bookmark the permalink.