Reply
Thread Tools
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#21
Originally Posted by DrWilken View Post
I see... I'm not sure this is something I would want to do, but the error message says that the 'su' binary isn't suid which can be solved by doing (as root - i.e. run 'sudo gainroot' or just 'root'):
Code:
chmod u+s /bin/su
Note: please check if you're not setting the suid bit on the entire busybox binary. (su might be a symlink to busybox)

If you are, then you will in trouble soon.

Suggestion: forget about everything said on this thread and just use "root" or "sudo gainroot".
 

The Following User Says Thank You to javispedro For This Useful Post:
Posts: 21 | Thanked: 0 times | Joined on Nov 2010 @ india
#22
Originally Posted by javispedro View Post
Note: please check if you're not setting the suid bit on the entire busybox binary. (su might be a symlink to busybox)

If you are, then you will in trouble soon.

Suggestion: forget about everything said on this thread and just use "root" or "sudo gainroot".
i have rootsh installed. i was able to use sudo gainroot / root and both were working and still working.
the only extra thing done here is
i set the password for root
i set the password for user.
and executed this command as suggested:
chmod u+s /bin/su
pls let me know what sort of problems i may face?
__________________
shail
 
Posts: 515 | Thanked: 266 times | Joined on Nov 2009 @ Oelsted, Denmark
#23
Originally Posted by javispedro View Post
Note: please check if you're not setting the suid bit on the entire busybox binary. (su might be a symlink to busybox)

If you are, then you will in trouble soon.

Suggestion: forget about everything said on this thread and just use "root" or "sudo gainroot".
You're absolutely right... It IS a symlink to busybox:
Code:
N900:~$ ls -l /bin/su 
lrwxrwxrwx 1 root root 7 2010-05-11 20:11 /bin/su -> busybox
In my defense, I did say "I'm not sure this is something I would want to do"...

To clean up the mess run this:
Code:
su -
chmod u-s /bin/su
And as said earlier as 'user' just type 'root' to become root (no password needed).

After this change You won't be able to use 'su -' anymore.
__________________
Christian Wilken - tux-POWER.dk!
... May the Source be with You ...

Last edited by DrWilken; 2010-12-24 at 10:49.
 
Posts: 21 | Thanked: 0 times | Joined on Nov 2010 @ india
#24
Originally Posted by DrWilken View Post
You're absolutely right... It IS a symlink to busybox:
Code:
N900:~$ ls -l /bin/su 
lrwxrwxrwx 1 root root 7 2010-05-11 20:11 /bin/su -> busybox
In my defense, I did say "I'm not sure this is something I would want to do"...

To clean up the mess run this:
Code:
su -
chmod u-s /bin/su
And as said earlier as 'user' just type 'root' to become root (no password needed).

After this change You won't be able to use 'su -' anymore.
Thanks alot.
i executed as suggested by you :
su -
chmod u-s /bin/su

Now i will try doing ssh which i was suppose to do yesterday. i will check and let you know.
Thanks for being patient with my queries and helping me out.
__________________
shail
 
Posts: 701 | Thanked: 585 times | Joined on Sep 2010 @ London, England
#25
Originally Posted by shailesh View Post
it was asking for a password (however it was not accepting the paasword) but now if i try to do sudo su -
it says
sorry, user user is not allowed to execute '/bin/su -' as root on Nokia-900.
i am pretty sure this wasnt the case earlier.
can u help me with this as well sir.
As I said before, it is sudo asking for your user password, so you must have entered your user password, it was accepted then sudo is telling you you don't have permission to run /bin/su.

To fix this you need to edit your /etc/sudoers file, it is dangerous to edit this file manually because if you don't do it properly sudo will complain and stop working, instead it is advisable to edit this with the command visudo (which will verify any changes you make for correctness before saving the new file), unfortunately visudo defaults to using the "vi" editor which isn't the easiest for a noob (but I like it).

For the fix:
- Become root using the command "root"
- Run "visudo"
- Switch vi to insert mode by pressing "i"
- Add either "user ALL=(ALL) /bin/su" to enable that specific command with sudo or "user ALL=(ALL) ALL" to enable all commands with sudo, and add it to the top of the file.
- Switch vi back to command mode by pressing "Esc"
- Save and quit vi by typing ":wq"
 
Posts: 21 | Thanked: 0 times | Joined on Nov 2010 @ india
#26
can u let me know how to make the directories, files & scripts appear in different color. coz its all showing in ame color.
is there any way to fix it?
__________________
shail
 
Posts: 212 | Thanked: 66 times | Joined on May 2010 @ India
#27
please tell me how to set password for root or user.I mean to say if i type sudogainroot it should ask me the password i set.I saw it on UBUNTU but unable to do so on N900.
 
Posts: 515 | Thanked: 266 times | Joined on Nov 2009 @ Oelsted, Denmark
#28
Originally Posted by retsaw View Post
As I said before, it is sudo asking for your user password, so you must have entered your user password, it was accepted then sudo is telling you you don't have permission to run /bin/su.

To fix this you need to edit your /etc/sudoers file, it is dangerous to edit this file manually because if you don't do it properly sudo will complain and stop working, instead it is advisable to edit this with the command visudo (which will verify any changes you make for correctness before saving the new file), unfortunately visudo defaults to using the "vi" editor which isn't the easiest for a noob (but I like it).

For the fix:
- Become root using the command "root"
- Run "visudo"
- Switch vi to insert mode by pressing "i"
- Add either "user ALL=(ALL) /bin/su" to enable that specific command with sudo or "user ALL=(ALL) ALL" to enable all commands with sudo, and add it to the top of the file.
- Switch vi back to command mode by pressing "Esc"
- Save and quit vi by typing ":wq"
Instead of messing directly in /etc/sudoers You can create a file in /etc/sudoers.d with just the settings You need...

Like this:
Code:
echo "user ALL=(ALL) /bin/su" > /etc/sudoers.d/custom-user.sudoers
or this (same but for ALL commands):
Code:
echo "user ALL=(ALL) ALL" > /etc/sudoers.d/custom-user.sudoers
or without password:
Code:
echo "user ALL= NOPASSWD: ALL" > /etc/sudoers.d/custom-user.sudoers
(Again, run 'root' before to become root)
__________________
Christian Wilken - tux-POWER.dk!
... May the Source be with You ...
 
Posts: 515 | Thanked: 266 times | Joined on Nov 2009 @ Oelsted, Denmark
#29
Originally Posted by udaychaitanya16 View Post
please tell me how to set password for root or user.I mean to say if i type sudogainroot it should ask me the password i set.I saw it on UBUNTU but unable to do so on N900.
Change to root:
Code:
root
Set password for user:
Code:
passwd user
or root:

Code:
passwd root
It still won't ask You for a password when You use 'sudo gainroot' or 'root' (which does the same thing. changes to root WITHOUT asking for a password). It's what the "rootsh" package is meant to do.
__________________
Christian Wilken - tux-POWER.dk!
... May the Source be with You ...
 
Posts: 515 | Thanked: 266 times | Joined on Nov 2009 @ Oelsted, Denmark
#30
Here's a guide for getting "Ubuntu-like sudo behaviour":

Create the new sudo rule:
Code:
root
echo "user ALL=(ALL) ALL" > /etc/sudoers.d/custom-user.sudoers
update-sudoers
Set user password:
Code:
passwd user
After this You can close the terminal and uninstall the rootsh package. Or just remove it using:
Code:
apt-get remove rootsh
Close the terminal and open a new one or exit out of the root shell using 'exit' or Ctrl-D.

To become root now type (enter Your 'user' password):
Code:
sudo su -
(Doing it this way there is no need to run sudo before commands if You've switched to root first)

Or if You just want to run a single command as root type (enter Your 'user' password):
Code:
sudo <command>
Oh, and Merry X-Mas BTW...
__________________
Christian Wilken - tux-POWER.dk!
... May the Source be with You ...

Last edited by DrWilken; 2010-12-24 at 14:17. Reason: Forgot to run 'update-sudoers'
 

The Following 3 Users Say Thank You to DrWilken For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 13:05.