Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 4100  / 3 Years ago, thu, september 9, 2021, 1:41:22

I'm a little bit noob. I can run a program in terminal with;



$sudo /opt/eclipse/eclipse


but I don't know how to create a shortcut that starts it with root privileges (They are installed in /opt so it needs root)


More From » root

 Answers
3

ALL of the default programs which come preinstalled with Ubuntu or which can be installed from repositories are "installed as root" in system directories, yet you do not need to superuser privileges to run them.



You're confusing the permissions necessary to read/execute a program with permissions necessary to override or delete the file. The program file may be owned by root, but if your user has execute privileges, you'll be able to run the program. The running process will have User ID of your user, so it won't be able to modify files owned by root.



This is an important security measure and running with super-user privileges should be reserved only for a small set of trusted applications which actually require this (i.e. the ones which make change to system configuration (Software Center and Update Manager) or directly access hardware devices (gparted).



Eclipse does not require root privileges regardless of whether it is installed in /opt or in your home directory (which I personally prefer). What's probably happening is that you started it as root the first time so the directory in your home folder which stores Eclipse configuration (home/(yourusername)/.eclipse) is owned by root. You need to change the directory's owner to give Eclipse to write there when started as non-privileged user:



chown -R yourusername:yourusername ~/.eclipse

[#35914] Friday, September 10, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
warrdel

Total Points: 356
Total Questions: 103
Total Answers: 118

Location: Bangladesh
Member since Sat, Jan 23, 2021
3 Years ago
;