On one of my Ubuntu 11.10 servers, when I use sudo -i to become the root user, root's .bashrc is not being executed.
I would like to write a bash script to perform some tasks under root while logging as normal user.
I would like to be able to use the sudo command in a chroot environment.
I start the chroot as follows:
chroot /debian-squeeze /bin/bash
Now I'm logged in as root in the chroot. I can do su user to log in as a user named user.
So if I disable my root account with sudo passwd -dl root I still have access to sudo {su,bash} or sudo -{s,i} conceptually how are the elavated rights different from the root account?
I know the difference between each of the elevations, or shells, I'm looking for an in-depth difference between an account and elevated rights?
Hi,
I have installed sudo on Solaris 10 (sparc). When I try to add a user I get the following:
----------------------------------------------------------
-bash-3.00$ sudo addusr scarlet sudo
sudo: /usr/local/etc/sudoers.d is owned by uid 2, should be 0
Password:
-----------------------------------------------------------
I entered a password, thinking it was for the sudo user but it failed.
When I tried to "sudo su" instead of "sudo su -" after having been logged in as root and su-ing to another user, it tries to sudo me as the new user, but via root...
When I type env, it shows still username=root in the environment. Is sudo not looking at the currently logged in user, but at the enviroment parameters?
I've seen this question in different forms on various forums. Each time, the result never seems to be a full answer. I would like to prevent users from being able to sudo to root while maintaining the ability to sudo to other users. As tedious a task as this is I already know I can lock out editing the sudoers file and from running sudo bash|sh|etc.
I'm using Ubuntu 12.10 and I have installed Android SDK, set it's path in my user .bashrc and it works.
The problem is that my phone requires adb to be ran by root for permissions, but running adb with sudo I get the following error:
sudo: adb: command not found
I tried to simply use sudo -E adb start-server, but it doesn't work.
A sample script can be as below:
#!/bin/bash
sudo su
ls /root
When using ./test.sh as the normal user, instead run ls as super user and exit, it switches to root; and when I logout, it executes ls /root as the normal user.
Can anybody tell me about the mechanism about it? Thanks.