root permission disable

May 21, 2013
2
0
10,510
From Linux From Scratch build a minimal system for running my application. but struck on disabling root permission.

Need my minimal lfs as ubuntu.

when ubuntu boots login-screen displays when we enter username and password it will redirect to Desktop from ter when we open a terminal it will open as $--> non root-user from ter we access #--> root via sudo.

Same as ubuntu when my lfs boots want to display my application [xinit-window launcher (same as login screen in ubuntu but, in my case with out asking user name and password)] and when i access terminal it should display as $--> non-root user then i want to use sudo to access root.

Thanks
 

molletts

Distinguished
Jun 16, 2009
28
0
18,610
I'm guessing that you've got a script somewhere late in the startup sequence that fires up xinit to start the X environment including your application. All the init scripts are run as root so everything they start will also be run as root by default.

The easiest way to get it to run as someone else is to use "su". Create a user for your application then modify the startup script to run something like:

su -c "xinit myapp" myuser

(Replace the "xinit myapp" with whatever you normally use to start your X environment and "myuser" with the username of the user you created.)
 
May 21, 2013
2
0
10,510
i understood wat u said.... after booting when i open a terminal it should be $ --> non-root user, when needed i want ot use su or sudo to access root .
Simply my os want to be in user permission not in root permission [Default it booting in root]