Let’s say you’re logged into your Ubuntu machine as an unprivileged user, meaning that you don’t have permission to use the sudo command on the command line. As such, you cannot update the system, install a program, or perform other tasks in the terminal that require the sudo command without logging out and then back in as the administrative user, or using the User Switcher. This annoys me. So, how do I execute commands in the terminal that require the sudo command while still logged in as the unprivileged user??
First off, you’ll need ssh. To make sure you have this installed, login to your administrative account (a step that will soon become unnecessary), open a terminal, and enter…
sudo apt-get install openssh-server openssh-client
After this install is finished you can logout, and back in as the unprivileged user.Now you can open a terminal and enter…
ssh [administrative username]@127.0.0.1
You’ll be asked for your password, this is the administrative account’s password, enter it and press enter. Now, you’ll have a command line prompt for the administrative user, as if you had logged in as that user and opened a terminal. You can now update the system, or make whatever change you need to make that requires you to enter your sudo password.
A nice time saving trick.
