Active Topics

 



Notices


Reply
Thread Tools
Guest | Posts: n/a | Thanked: 0 times | Joined on
#1
Just an idea.
I was bored to type "sudo gainroot" every time I opened the xterm. So I made a shortcut on the desktop, which links to a xterm, which is already "gainrooted", that means: the "sudo gainroot" command has already been typed.
I've found the idea here, a thread about desktop command-shortcuts.
My code is:
Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Terminal=true
Name=su-xterm
Exec=/usr/bin/osso-xterm 'sudo gainroot'
Icon=
X-Osso-Type=application/x-executable
just put it into a file called NAMEOFTHEFILE.desktop in /usr/share/applications/hildon/.

This add an application in the menu called su-xterm. You can make a shortcut to this application on the desktop. After running it, verify if you are root by typing:
Code:
whoami
If you want a nice shortcut's icon, check this post.

I suggest to delete the shortcut to the normal xterm (if you have one), so you can't choose the wrong one. Remember: if you open a new terminal by tapping the upper bar in an opened xterm and then "new" button, you will be USER, not root. Just type "sudo gainroot" again and have fun!

(Obviously you need the rootsh package. )

Note: I'm not an expert and this is just a simple idea. Please comment!
 

The Following 3 Users Say Thank You to For This Useful Post:
Posts: 162 | Thanked: 79 times | Joined on Jan 2010 @ Finland
#2
Umm.. the first comment would be that you should not use this if you happen to use x-terminal in other ways than root. Might not be that bad if you just use the terminal to crack things up, but otherwise this is not the safest idea if you just accidentally forget that you're always automatically root.
 

The Following 2 Users Say Thank You to chainreaction For This Useful Post:
Posts: 755 | Thanked: 406 times | Joined on Feb 2008 @ UK
#3
Agreed - the extra step to switch to root is imho a good idea - so you're aware of what you're doing.
 

The Following 2 Users Say Thank You to codeMonkey For This Useful Post:
Guest | Posts: n/a | Thanked: 0 times | Joined on
#4
Originally Posted by chainreaction View Post
Umm.. the first comment would be that you should not use this if you happen to use x-terminal in other ways than root. Might not be that bad if you just use the terminal to crack things up, but otherwise this is not the safest idea if you just accidentally forget that you're always automatically root.
That's true.
But I've not yet used the xterminal as user. I need beeing root for the most of the things I set by command-line.
For the other things I will use the normal xterminal.
 
Posts: 755 | Thanked: 406 times | Joined on Feb 2008 @ UK
#5
As long as you're aware of the risks Happy learning!
 

The Following User Says Thank You to codeMonkey For This Useful Post:
Posts: 87 | Thanked: 47 times | Joined on Sep 2009 @ Sorocaba, Brasil
#6
Originally Posted by Matjaz View Post
That's true.
But I've not yet used the xterminal as user. I need beeing root for the most of the things I set by command-line.
For the other things I will use the normal xterminal.
If you happen to almost use your xterm as a root, you could also add the gainroot command to your .profile rather than creating two different shortcuts.

Look here:

http://lists.maemo.org/pipermail//ma...ry/000450.html
 

The Following User Says Thank You to dalonso For This Useful Post:
Guest | Posts: n/a | Thanked: 0 times | Joined on
#7
Originally Posted by codeMonkey View Post
As long as you're aware of the risks Happy learning!
Thanks!
I know that if you are root and you don't know what are you doing your N900 can explode in your hands , but at the moment I'm still a N900b and don't know how to change some complex configuration files or the kernel or something like that....

Thanks again!
 
Bec's Avatar
Posts: 876 | Thanked: 396 times | Joined on Dec 2009
#8
How can I launch an app directly after registering as root?

Exec=/usr/bin/osso-xterm 'sudo gainroot' emelfm2
Exec=/usr/bin/osso-xterm 'sudo gainroot emelfm2'
Doesn't seem to work...
__________________

Last edited by Bec; 2010-01-17 at 19:38.
 
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#9
Add the application to sudoers by creating a file called
/etc/sudoers.d/emelfm2.sudoers containing:
user ALL = NOPASSWD: /usr/bin/emelfm2
Then use Exec = /usr/bin/sudo /usr/bin/emelfm2
or Exec = osso-xterm "sudo emelfm2"
 

The Following User Says Thank You to Matan For This Useful Post:
Bec's Avatar
Posts: 876 | Thanked: 396 times | Joined on Dec 2009
#10
I have no idea what I'm doing wrong:
/etc/sudoers.d/emelfm2.sudoers

with
user ALL = NOPASSWD: /usr/bin/emelfm2 also tried with (%) in front and with the line in "01sudo"

and the emelfm.desktop with:
Exec = /usr/bin/sudo /usr/bin/emelfm2 => the app processes for a little while than it just quits.
Exec = osso-xterm "sudo emelfm2" => it asks for a password...

i tried sudo gainroot, passwd, set a new password and then replaced the "NOPASSWD" ... didn't work.

What am I doing wrong?
__________________

Last edited by Bec; 2010-01-17 at 21:03.
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:11.