Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Running Screenlets as Root User
New Posts  All Forums:Forum Nav:

Running Screenlets as Root User

post #1 of 7
Thread Starter 
I tried running Screenlets on my backtrack build as root user just to find out the program denies most features to the root user. I googled this issue and found one tutorial that stopped the error from popping up but the program still recognized me as being the root user and limited the features available to me.

With few options I decided to give it a shot and it works just fine. Here is what I did.

1) Open up a terminal and type
Code:
gedit /usr/share/screenlets-manager/screenlets-manager.py

2) Press CTRL + F to open up a search prompt, search "geteuid"

3) Replace "geteuid" with "getppid"

4) Press CTRL + S to save then exit


VIOLA!!! Everything should work as expected. If you are annoyed with the prompt that says you are running as root user you can always use this method courtesy of http://www.webupd8.org/2009/06/how-to-use-screenlets-vlc-and-awn.html

1. Press Alt + F2, enter or open a terminal and type:
Code:
gedit /usr/share/screenlets-manager/screenlets-manager.py

2. Search for:
if USER == 0

And replace 0 with 1, each time the above code is displayed.
Edited by tha d0ctor - 12/23/11 at 10:48pm
post #2 of 7
you know .py files are plain text right..... hexeditor ... wink.gif

generally if a program doesn't function as root it's not supposed to for a good reason. you're really not supposed to do anything as root except system level stuff... you probably want to grant your account the minimum permissions to do whatever it is that you need "root" to perform.. and then you can avoid hacking code up that you'll have to keep doing again and again.. thumb.gif
stable again
(25 items)
 
  
CPUCPUMotherboardGraphics
E5-2687W E5-2687W ASUS Z9PED8-WS EVGA GTX 570 (Linux host) 
GraphicsRAMHard DriveHard Drive
EVGA GTX 970 FTW (win7 guest) 64GB G.SKILL 2133 2x Crucial M4 256GB raid1 4x 3TB raid 10 
CoolingCoolingCoolingCooling
2x Apogee HD  2x RX 480 2x MCP 655 RP-452x2 rev2 (new) 
CoolingCoolingOSOS
16x Cougar Turbine CFT12SB4 (new) EK FC 580 Gentoo (host) Gentoo (x23 guests) 
OSMonitorMonitorPower
windows 7 (guest w/ vfio-pci) Viewsonic 23" 1080P Viewsonic 19" Antec HCP Platinum 1000 (new) 
CaseOtherOther
Case Labs TH10 (still the best ever) 2x Lamptron FC-5 IOGEAR 2 way DVI KVM Switch 
  hide details  
Reply
stable again
(25 items)
 
  
CPUCPUMotherboardGraphics
E5-2687W E5-2687W ASUS Z9PED8-WS EVGA GTX 570 (Linux host) 
GraphicsRAMHard DriveHard Drive
EVGA GTX 970 FTW (win7 guest) 64GB G.SKILL 2133 2x Crucial M4 256GB raid1 4x 3TB raid 10 
CoolingCoolingCoolingCooling
2x Apogee HD  2x RX 480 2x MCP 655 RP-452x2 rev2 (new) 
CoolingCoolingOSOS
16x Cougar Turbine CFT12SB4 (new) EK FC 580 Gentoo (host) Gentoo (x23 guests) 
OSMonitorMonitorPower
windows 7 (guest w/ vfio-pci) Viewsonic 23" 1080P Viewsonic 19" Antec HCP Platinum 1000 (new) 
CaseOtherOther
Case Labs TH10 (still the best ever) 2x Lamptron FC-5 IOGEAR 2 way DVI KVM Switch 
  hide details  
Reply
post #3 of 7
Thread Starter 
edited to just use gedit instead of hexedit, sorry I like using terminal too much wink.gif

As for root perms I totally understand what you are saying but, since I run mostly backtrack I require root for certain tasks and, t I don't want to reconfigure another desktop to my needs out of sheer laziness.
Edited by tha d0ctor - 12/23/11 at 10:34pm
post #4 of 7
i guess you've never heard of vi or emacs maybe... using a hexeditor on plaintext is kind of the opposite of 1337 wink.gif

and yeah there's a lot of situations where lazyness comes into play "just use root" is the way to go..smile.gif
stable again
(25 items)
 
  
CPUCPUMotherboardGraphics
E5-2687W E5-2687W ASUS Z9PED8-WS EVGA GTX 570 (Linux host) 
GraphicsRAMHard DriveHard Drive
EVGA GTX 970 FTW (win7 guest) 64GB G.SKILL 2133 2x Crucial M4 256GB raid1 4x 3TB raid 10 
CoolingCoolingCoolingCooling
2x Apogee HD  2x RX 480 2x MCP 655 RP-452x2 rev2 (new) 
CoolingCoolingOSOS
16x Cougar Turbine CFT12SB4 (new) EK FC 580 Gentoo (host) Gentoo (x23 guests) 
OSMonitorMonitorPower
windows 7 (guest w/ vfio-pci) Viewsonic 23" 1080P Viewsonic 19" Antec HCP Platinum 1000 (new) 
CaseOtherOther
Case Labs TH10 (still the best ever) 2x Lamptron FC-5 IOGEAR 2 way DVI KVM Switch 
  hide details  
Reply
stable again
(25 items)
 
  
CPUCPUMotherboardGraphics
E5-2687W E5-2687W ASUS Z9PED8-WS EVGA GTX 570 (Linux host) 
GraphicsRAMHard DriveHard Drive
EVGA GTX 970 FTW (win7 guest) 64GB G.SKILL 2133 2x Crucial M4 256GB raid1 4x 3TB raid 10 
CoolingCoolingCoolingCooling
2x Apogee HD  2x RX 480 2x MCP 655 RP-452x2 rev2 (new) 
CoolingCoolingOSOS
16x Cougar Turbine CFT12SB4 (new) EK FC 580 Gentoo (host) Gentoo (x23 guests) 
OSMonitorMonitorPower
windows 7 (guest w/ vfio-pci) Viewsonic 23" 1080P Viewsonic 19" Antec HCP Platinum 1000 (new) 
CaseOtherOther
Case Labs TH10 (still the best ever) 2x Lamptron FC-5 IOGEAR 2 way DVI KVM Switch 
  hide details  
Reply
post #5 of 7
Thread Starter 
Quote:
Originally Posted by lloyd mcclendon View Post

i guess you've never heard of vi or emacs maybe... using a hexeditor on plaintext is kind of the opposite of 1337 wink.gif

and yeah there's a lot of situations where lazyness comes into play "just use root" is the way to go..smile.gif

nope never heard of them. I put in the hexedit cause I didn't know you could open gedit and a specific file from command line. But thanks for the input, I took you advice and tried using "gedit /path/to/the/file.py" and it opened up the file so I adjusted the tutorial to reflect these changes, resulting in a shorter how-to smile.gif thanks!

I'm a new linux user so there is a lot I don't know but, I know enough to have changed my root password wink.gif
Edited by tha d0ctor - 12/23/11 at 10:53pm
post #6 of 7
As the other guy had said, you're approaching this backwards. You should be running everything as user and only elevating your permissions when you need to.
Thus if you need to run nmap, then sudo nmap.

If you're feeling extraordinarily lazy, you can set special permissions up like SUID so that root programs execute with root permissions even when launched by a non-root account. Or, slightly more secure, set those programs to not prompt for a password in your sudoers file.

However running everything as root is a bad idea.
post #7 of 7
Thread Starter 
Quote:
Originally Posted by Plan9 View Post

As the other guy had said, you're approaching this backwards. You should be running everything as user and only elevating your permissions when you need to.
Thus if you need to run nmap, then sudo nmap.

If you're feeling extraordinarily lazy, you can set special permissions up like SUID so that root programs execute with root permissions even when launched by a non-root account. Or, slightly more secure, set those programs to not prompt for a password in your sudoers file.

However running everything as root is a bad idea.

Thanks or the input. Do you have any resources you could refer me to to set this type of stuff up because I'm aware of the security implications of running as root.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Running Screenlets as Root User