LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Suse/Novell (http://www.linuxquestions.org/questions/suse-novell-60/)
-   -   Autologin root user GUI (http://www.linuxquestions.org/questions/suse-novell-60/autologin-root-user-gui-947445/)

josephw47 05-29-2012 02:22 PM

Autologin root user GUI
 
Hi
I already know I'm probably going to get flamed for this but I need to make SLES 11 automatically log in the root user when the GUI starts.

(Hopefully this will limit the flames)
I work in a hardware test environment, I can't tell you what I'm working on, but I have a program that tests a specific hardware function within the OS... The program only runs in GUI mode, and in order to automate this software, I have to get the root user logged in at boot in the GUI. I didn't write the program, nor do i have the authority to get the person who wrote it to change it to where it works in the shell. :(

I would prefer a script that would run at startup that would start the GUI from runlevel 3 and and log in as the root user.... and bash is not my forte'

TobiSGD 05-29-2012 03:46 PM

Quote:

Originally Posted by josephw47 (Post 4690541)
I would prefer a script that would run at startup that would start the GUI from runlevel 3 and and log in as the root user.... and bash is not my forte'

No, what you need is a script that starts your program as root when the normal user is logged in automatically (via the normal display manager functions). This is much safer and won't get you flamed.

At first you have to enable your normal user to start the application as root without giving a password. this can easily be done with sudo. Assuming that your normal user's name is josephw47 and the application is named /usr/sbin/rootapp the entry in /etc/sudoers (configurable with visudo) for that should look like this:
Code:

josephw47 ALL=NOPASSWD: /usr/sbin/rootapp
If that entry is added you can test your application with
Code:

kdesudo rootapp
if you use KDE or
Code:

gksudo rootapp
if you use Gnome or XFCE. If you can start the app successfully this way just add an entry with that command to your GUIs autostart-feature.

Remember, there is never a need to start a whole GUI as root just for one program.


All times are GMT -5. The time now is 04:47 PM.