![]() |
an already "gainrooted" xterm
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] 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 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! |
Re: an already "gainrooted" xterm
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.
|
Re: an already "gainrooted" xterm
Agreed - the extra step to switch to root is imho a good idea - so you're aware of what you're doing.
|
Re: an already "gainrooted" xterm
Quote:
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. :o For the other things I will use the normal xterminal. |
Re: an already "gainrooted" xterm
As long as you're aware of the risks :) Happy learning!
|
Re: an already "gainrooted" xterm
Quote:
Look here: http://lists.maemo.org/pipermail//ma...ry/000450.html |
Re: an already "gainrooted" xterm
Quote:
I know that if you are root and you don't know what are you doing your N900 can explode in your hands :D, 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! |
Re: an already "gainrooted" xterm
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... |
Re: an already "gainrooted" xterm
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" |
Re: an already "gainrooted" xterm
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? |
Re: an already "gainrooted" xterm
I forgot a step. Run update-sudoers (as root) after creating the .sudoers file.
|
Re: an already "gainrooted" xterm
ok, now this looks interesting:
Quote:
Quote:
Thanks |
Re: an already "gainrooted" xterm
Editing the sudoers file is very difficult to use anything but VI. (I don't know what you use)
The actual recommended way is using "visudo".. I don't know if the N900 has that or not. Essentially even wrong end of line characters can cause sudo to stop working. Just some thoughts... in vi if you use ":set list" you can see the end of line characters... ^M == bad. |
Re: an already "gainrooted" xterm
Just don't reboot, Bec, as you might need to reflash your system if you do. Copy a working 01sudo file (for example, from here: http://my.arava.co.il/~matan/770/n900/01sudo ) and run update-sudoers.
|
Re: an already "gainrooted" xterm
Quote:
Quote:
|
Re: an already "gainrooted" xterm
Quote:
sudo gainroot asks for a password... For the first time I use it, no matter how many times I've tried to set one (always the same) it didn't seem to work... Problem is that the usual password doesn't work... |
Re: an already "gainrooted" xterm
It asks for user's password, not root password. Did you install openssh server? If so, ssh directly to root.
|
Re: an already "gainrooted" xterm
I've ssh-ited it... surprisingly it stopped asking for a password... awkward
|
Re: an already "gainrooted" xterm
Quote:
Thanks |
Re: an already "gainrooted" xterm
visudo is an editor that checks the file has the corrext syntax for a sudoers file before overwriting the original.
|
Re: an already "gainrooted" xterm
Ok, but is it compatible/ported for maemo or is is x86 linux only?
And the stupid question... anything similar for us windows users? |
Re: an already "gainrooted" xterm
As a rule of thumb.. *never* use a windows text editor to edit linux files. Windows uses different end of line characters by default than Linux. Causes many weird things.
I believe visudo is already on the device - or at least available in the repo's (can't check atm). The sudoers file is very very sensitive. |
Re: an already "gainrooted" xterm
On my N900, visudo tells me no editor is set. I guess I have to make a symbolic link to /bin/vi however I do that.
|
Re: an already "gainrooted" xterm
Code:
export EDITOR=/bin/vi |
Re: an already "gainrooted" xterm
Ok, after this nice experiment I suddenly got awful battery issues. I need to investigate further...
EDIT1: something is "stuck" in the memory and pushes the cpu to 100% EDIT2: tried to run visudo and although "nothing happened", I got myself a nice running app called "vi" that was using my cpu 90-100%. The battery lasted 8 hours this way. |
Re: an already "gainrooted" xterm
Maybe add a red colourized xterm icon as well :)
|
Re: an already "gainrooted" xterm
2 Attachment(s)
Trying to follow the steps in this thread for a rooted xterm resulted in nothing. So I found a different way to do it.
Gain root access to a terminal : ssh / terminal + sudo gainroot 1.1. vi /usr/share/rootedXterm.sh 1.2. This command will create a file named rootedXterm.sh and open an editor named vi to edit it. VI is not an easy editor to work with if you don't know what you are doing, so please pay attention to the steps. 2.1. Now we will insert a line into out newly created file : 2.2. Press "i" > Type > sudo gainroot > Press ESC > Type :wq! 2.3. Press Enter. 3.1. Now we give our new file run permissions. 3.2. Type "chmod 755 /usr/share/rootedXterm.sh" press Enter. 4.1. Now we create a "desktop shortcut" for our new script. 4.2. Type : "vi /usr/share/applications/hildon/rooted_xterm.desktop" 4.3. Press "i" to enter "insert" mode, and insert or paste the following code into your file : Code:
[Desktop Entry] 4.5. type ":wq!" And press enter, to save and exit the file. 5.1. We are done editing files, close the ssh or terminal window. 5.2. In your phone, go into your application manager, wait for it to refresh, and close it. 5.3. The new Rooted Xterm should now appear in you applications. 5.4. Create a desktop shortcut for it if you want as you normally do for other apps. GL. Beware, root is a dangerous mode, you can do whatever you want, including messing up your device. Eitam. Attachment 8063 Attachment 8064 |
Re: an already "gainrooted" xterm
Quote:
|
Re: an already "gainrooted" xterm
1 Attachment(s)
Quote:
It is the correct size BTW. |
Re: an already "gainrooted" xterm
Quote:
|
All times are GMT. The time now is 20:22. |
vBulletin® Version 3.8.8