New answers tagged su
runuser is a recent command, it appeared in util-linux 2.23. Ubuntu 14.04 ships util-linux 2.20, so it doesn't have this command yet. runuser isn't very useful. Just use su instead. Note that the command runuser user -c 'cd' doesn't actually do anything — the scope of cd does not extend to the next call to runuser. You'd have to use runuser user -c 'cd ...
Try comparing the environments: $ sudo -s # diff <(su username -c env) <(sudo -u username bash -c env) For example, the environment for sudo is controlled by env_* defaults in /etc/sudoers.
You can do this in single user mode. Restart system, at grub prompt press down or up arrow so grub screen will be pause. Press "e" to edit grub entries, Select the kernel line and again press "e" to edit mode Now add "1" or "single" at end of the line. and press enter. Press "b" to boot with this setting. Now fedora will start in single user mode. Now you ...
If you don't have root password, You have to boot with a Live-CD and chroot to your partition, find out to read only mounted or rw mounted with mount command. If read only mounted, use the following command: mount -o rw,remount / Then use : passwd root
The su binary is provided by the login package. You can reinstall it and get your su back by running apt-get install --reinstall login This assumes that you have root access of course but since you said you still have a root session open, that shouldn't be a problem.
Since you can only run su - other_user to get access to that account, there are things you can't do. You can only run the login shell of that account or programs that the login shell allows you to run. This doesn't make a difference if the login shell is a general shell like sh or bash, but it does if the shell is a restricted shell or some kind of ...
Does this security policy make sense? Yes and no. No in the sense that it does not protect other_user's data. But it does protect other_user's password. This may seem inconsequential, but that means there is at least one important thing you cannot do: change the password so that the person who normally uses the account can't access it. Another ...
Use: su --login -c 'bash -ic "ll"' test which will put you in user test's home directory, or: su -c 'bash -ic "ll"' test which leaves you in your current directory.
Have You tried /etc/sudoers? your_user ALL=(ALL) NOPASSWD: /path/to/script.sh (edit with: sudoedit /etc/sudoers) then, You will be able to run: sudo /path/to/script without password
Based on your error message, it looks like the login shell for the root user is not set properly in the /etc/passwd file. $ grep root /etc/passwd root:x:0:0:root:/root:/bin/bash Mostly in your system it might be as root:x:0:0:root:/root:/bin/bash/**** Where **** is your username. Open /etc/passwd file and correct the login shell.
Top 50 recent answers are included