2

While logged in as the root account of a CLI installation, almost every application gives me this error:

Don't run this as root!

I want to bypass this error and run the application while logged into root. How do I do this?

Edit: I understand the risks of using the root user and I will still want to use it. Thank you for your suggestions.

Dev
  • 692
  • 3
    Why do you need to run applications as root? – Pilot6 Jul 11 '16 at 09:46
  • @Pilot6 The root account will be my main account on the system. – Dev Jul 11 '16 at 09:52
  • Why the downvote? Am I doing something wrong? – Dev Jul 11 '16 at 09:53
  • Ant what is the reason of having root as the main account? It is a bad idea. I did not downvote. – Pilot6 Jul 11 '16 at 09:53
  • @Pilot6 I know it is. But that is not the question. – Dev Jul 11 '16 at 09:54
  • There is serious security implications of having root account enabled. Avoid it as much as possible – Sergiy Kolodyazhnyy Jul 11 '16 at 09:54
  • 1
    Read this: http://askubuntu.com/a/207481/163331 – Parto Jul 11 '16 at 09:55
  • Unless you know it's a bad idea but you still want to do it... – Parto Jul 11 '16 at 09:56
  • Then these will help: http://askubuntu.com/questions/16178/why-is-it-bad-to-login-as-root and http://askubuntu.com/questions/91598/how-do-i-login-as-root and http://askubuntu.com/questions/44418/how-to-enable-root-login and http://askubuntu.com/questions/6676/why-is-there-no-option-to-login-as-root – Parto Jul 11 '16 at 10:04
  • I do understand the risks of using the root user @Parto , and already have it enabled. – Dev Jul 11 '16 at 10:06
  • 1
    "Edit: I understand the risks of using the root user." No, you don't. Use a system that uses root and not sudo by default. Picking Ubuntu implies using sudo. – Rinzwind Jul 13 '16 at 06:59
  • You have no right to tell me what I do and don't know. I know the risks of using the root user, and I'm not using it anymore. – Dev Jul 14 '16 at 19:59

4 Answers4

3

You may add your very own User with sudo rights. You can create a User and add this User to the sudo Group.

sudo adduser youruser sudo

Or if you already have a user, you can add this to the sudo Group.

sudo usermod -a -G sudo youruser

After this log in to this user with su youruser and try to run the installation again with sudo yourinstallcommand.

You should never run any Installations with the root User. User always your very own User with sudo due to security reasons.

  • I re-worded my question so people may understand I am looking to run the application using the root account. Thanks for your help, but unfortunately I do not wish to use this method. – Dev Jul 11 '16 at 09:56
  • You cant install the software with the root user. Just add your very own User with root privileges as described above. – bobbybackblech Jul 11 '16 at 10:07
1

Fortunately this question has an answer that works. Using the root account is insecure and I understand that. The accepted answer there is going to help me a lot. Thank you for your suggestions, criticism, and help, bobbyblackblech, Pilot6, Serg, and Parto.

Dev
  • 692
1

Ubuntu comes with sudo by default. sudo is a package/command that allows you to run any command/application as root (sudo stands for SuperUser Do).

Your user is by default in sudoers file if you are administrator (who installs the system, per example).

Simply type:

sudo <command>

Example:

sudo gedit

This runs gedit as root. BE EXTREMELY CAREFUL WITH SUDO AND SUPERUSER/ROOT.

0

In addition to sudo, you might also need to disable X access control within your user X session:

xhost +
sudo foo
...
sudo bar

For foo and bar being X applications.

But I agree with everybody: don't do that!