How do I start a new developed application in root?


I am using debian OS and I have an application saved in a specicific folder lets say ./myfolder/myapp.cpp

I make exe_myapp in the same folder.

I need this application (exe_myapp) to be started in the root. HOW?

Who is Participating?

Improve company productivity with a Business Account.Sign Up

expert_tanmayConnect With a Mentor Commented:
Start a terminal command prompt.
type the commands on the terminal as follows
> su
password : <put the root password>
#cd your_folder

thats it
LeeeRussellConnect With a Mentor Commented:
It can be safer in linux to not stay logged in as the superuser an only execute a single command as su.  This can be done using sudo.  In your example you would type in:

sudo ./exe_myapp

and then the system will ask for your password.

Sudo for debian is explained here:
FerrostiConnect With a Mentor Commented:
Having the program in '/' is no good.
You should be able to place your program nearly anywhere. In your code change your working directory to '/' when needed.

int chdir (const char *filename)
nabilhammoudAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.