1

I have few applications which I need to run on root permission. Am pretty new to Ubuntu, the kind of shortcut I do to gain root access was that I open a new terminal with sudo -i and will launch my applications from that terminal. But I need to be cautious while I was in this terminal since I can accidentally mess up something.

Am I doing it right here ? am aware of what sudo -i does but my query here is to find any other way that I can achieve this feat or was it only sudo -i

Thanks in advance.

3
  • 1
    What applications are these that you "need to run on root permissions"? Feb 7, 2016 at 13:21
  • 1
    Possible duplicate of What is the functional difference between sudo su and sudo -i?
    – muru
    Feb 7, 2016 at 13:22
  • I am developing a Qt application to run on a Embedded Linux machine. I have tool chains cross-compiled specific to my target machine where I will be deploying my Qt application. So when I want to run my Qt application on local Ubuntu machine, I would be accessing some resources from /etc, /lib directories which is not working as expected unless I launch Qt Creator application with root permissions. So I basically login with sudo -i and launch my Qt Creator in that terminal.
    – user12345
    Feb 7, 2016 at 14:08

1 Answer 1

0

Not "safe" at all. Running a command terminal as root makes everything you do (including mistakes) Very Powerful, and when you try (intentionally or not) to do something dumb, you're not protected by the restrictions placed on non-root users.

Programs generally should not require root to run (the exceptions are programs that manipulate the system state: mount/unmount disks, install software, shutdown, etc). From the sparse information in your question, it sounds like you have a permissions problem. Figuring out, and solving the permissions problem should be your first step, running as root should be the infinitely last step (there must be another way)

2
  • Yep, I sense that problem. I need to figure it out, but basically my requirement is that - my application uses the resources from /etc directory which is running fine on my target machine which is by default root, but when I run that program on Ubuntu I had a problem.
    – user12345
    Feb 7, 2016 at 14:35
  • 1
    Most of the files in /etc are readable by non-root users. What do you need to read from /etc? If your application needs to write to /etc, I will assert "Bad Design!"
    – waltinator
    Feb 7, 2016 at 15:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .