Questions tagged [su]
The "substitute user" Unix command that changes the current user
182
questions
1
vote
0
answers
22
views
Can't use `su` anymore nor use `sudo` after using `sudo apt-get upgrade` (Debian)
I'm having an issue right now. To set the scene : I'm currently working on a V2 for a Rails project, with more recent versions, gems, features etc, working with Nginx and Docker. In order to make it ...
0
votes
0
answers
52
views
Debian 11: no root access anymore
After trying to reinstall my amd-gpu-drivers, my system rebooted into CLI. So I tried to reinstall GUI with "apt install task-gnome-desktop". After this my system says sudo is an unknown ...
1
vote
0
answers
99
views
RHEL 8.7 Server Unable to "su root" Consistently
This particular server was set up with the "French National Agency for the Security of Information Systems (ANSSI) BP-028 Enhanced Level" security profile that is packaged with RHEL. After ...
0
votes
0
answers
93
views
Linux - Switch user to subuid running LXC container
I'd like to either use su or sudo -u to switch users to the subuid created by LXC to run a container as unprivileged.
Note:
There is no username assigned to the UIDs in which containers are run.
Due ...
1
vote
1
answer
582
views
Sudo and su root not working
I want to use the sudo command but whenever I type it I see a message that says void is not in the sudoers file, this incident will be reported. I tried finding a way to fix it, and the told me to ...
0
votes
0
answers
38
views
These scripts work on their own but when I try to put them in on script it fails
So I need these in one script. The first operation must be run as super user to run and for the proper permissions, the second operation must be run as the current logged in user. The script gets to ...
1
vote
2
answers
3k
views
Getting "Error skipping startup message" when connecting with "sudo su" shell in WinSCP
My WinSCP config:
File protocol: SCP
user name: namjoo
port: 22
settings > SCP/Shell > Shell: sudo su -
When I try to connect I get this error:
Error skipping startup message. Your shell is ...
0
votes
1
answer
555
views
how to get to 'username' from 'username@server' on ubuntu terminal?
My terminal on ubuntu 20.04 looks like:
I don't know what is @server after the username, but I guess it is a leftover from an earlier now meaningless installation of something.
My question is how to ...
0
votes
1
answer
61
views
Is there a .k5login equivalent on Windows?
Having obtained a Kerberos ticket, I can switch identities on Linux and BSD machines with su (or ksu), because the target account lists my main principal in its ~/.k5login.
Can the same authorization ...
0
votes
1
answer
109
views
Super user binary source for Debian distro
I'm trying to craft a new root handle in a Debian distro and need to know where the source code for the su binary is located in order to move forward. Can anyone point me in the right direction?
0
votes
3
answers
1k
views
How can I switch to root on Ubuntu? NO sudo
Yes, I know sudo is a better way but this is a particular case where sudo isn't an option.
On most Unix/Linux distributions this works by adding a user to a group (wheel, root) but I can't figure out ...
0
votes
0
answers
109
views
su processes spawning with high CPU (Debian 9)
I am running a VM on Google Cloud with Debian 9. I should be the only user with access to the VM.
Every so often the Web application I am running (phpbb) becomes very slow.
When I log into to look at ...
1
vote
0
answers
4k
views
sudo su - with error su: failed to execute /bin/bash: Permission denied
I have a Red Hat Enterprise Linux Server release 7.7.
Local user created. Sudoers file configured with ALL = (ALL) ALL for the user. The user can execute any command, like: sudo ls, sudo cat, sudo ...
0
votes
1
answer
633
views
Is it possible to modify the '/bin/su' command so that it will allow root access without password and without checking command ownership?
I don't know well how the su command works. I know that sudo command must be owned by root for it to work.
Is it possible to modify the su command so that it runs the root shell without asking for the ...
0
votes
0
answers
379
views
SCP with login to server and login to app user
I am trying to copy files from my local machine onto a remote server. The only issue is that I must first ssh user@host, enter my password, then sudo su - appuser, and enter my password again.
I have ...
1
vote
1
answer
1k
views
Left arrow key prints `^[[D` when I do `sudo su otheruser` on headless Ubuntu 18, via ssh using MobaXterm on Win 10. How do I move one char left?
I sometimes need to login as the application user to do some manual operations, debugging, or handling a failure. I don't want to go into our password management system to fetch the application user's ...
1
vote
2
answers
790
views
I can not su or sudo -i as root, and also can not ssh as root.But they all can work with other users
The screenshot
Doesn't work as root
sudo -i and su can not work as root.
[atguigu@hadoop103 ~]$ sudo -i
[atguigu@hadoop103 ~]$ su
Password:
ssh login as root and it was closed instantly.
[atguigu@...
0
votes
2
answers
97
views
With `su <name> --login`, what's the alternative to --login?
The man page for su states that for su <name> --login, adding the --login makes it a login shell. What's the alternative to this? I assumed that since you're changing the user, you have to log ...
0
votes
1
answer
57
views
How do I go about removing a built-in application on MacOS Catalina 10.15.6?
Here are the things I've tried...
I'm within /System/Application, went into Finder and was able to change permission to custom and have set both Admin/Everyone to Read/Write.
Disabled SIP
Became root ...
1
vote
0
answers
619
views
su and passwd : Authentication error
I had a strange behaviour with su - command. In fact I can't use /usr/bin/su - to get to root account. I use sudo which works perfectly but some other users, also in sudoers, are able to change sudo ...
0
votes
0
answers
164
views
Add command “su” with account disable-login in script sudo
I need to run a script with "sudo" right and at some point in the script I have to run a program with "(su $TS3_USER -c "$TS3_DIR/ts3server_startscript.sh start")" to ...
1
vote
1
answer
175
views
Run CI command as non-root using su
Our CI servers use docker images that are all running as root.
Now I have a Maven build that can't run as root, so I'm trying to build this wrapper script for creating a user, copying the Maven ...
0
votes
1
answer
363
views
Ansible: Switching to su user and when running tivoli db2 command, gives command not found
when manually ran db2 command on the server works. But when executing using ansible which switches to the user but fails to run the db2 command. I am stuck on this issue for the whole day. Any ...
0
votes
0
answers
323
views
user with restricted bash: sudo su works but su doesn't
I'm creating an user with restricted bash. I've blocked all commands except few commands as per a requirement.
Now if I want to change to root using su - root, even with correct password, it says ...
0
votes
1
answer
326
views
Su Into New Environment and Run Command from New User As Alias
I would like to run a su - <desired_user> but then also execute a command. I want to become that user in the new shell but just source a specific file.
The desired_user above is a batch user, ...
1
vote
0
answers
26
views
sudo asks password although there is nopasswd parameter [duplicate]
I edited the sudoers file like below:
myuser ALL=(ALL) NOPASSWD: ALL
newuser ALL=(ALL) NOPASSWD: ALL
There is no another line that contains "myuser" in sudoers file. But ...
0
votes
1
answer
644
views
How can I change user and keep my .profile
I often have to work as root (using sudo), but I want to keep my settings from my login profile - I have had this working in the past, but I don't quite remember how I made it work. This is what I've ...
0
votes
1
answer
159
views
command su returns prompt-less authentication after editing password through passwd as root user
I made absolutely no change except for running password <user> as root. After logging back in as <user> and running, for example, su pkg install rsync mtr I am returned the following su([...
0
votes
1
answer
552
views
How to su into another user and run commands with subsequent interactive shell
My goal is to su into user2, run commands that reference user1's environment, and also initiate an interactive shell as user2. I'm trying to create a function that allows me to keep forwarding X after ...
8
votes
6
answers
4k
views
Allowing automatic command execution as root on Linux using SSH
What is a good setup that allows automatic execution of a command or a script on a remote server with root privileges using SSH?
I'm aware (only vaguely for some the options) of the following options:
...
0
votes
1
answer
109
views
-c flag missing from su under macOS?
I am using El Capitan 10.11.6 and need to use su -c to run psql as the _postgres user. The problem is, this flag is absent on my version of macOS. Can't speak for other newer versions of macOS (...
0
votes
1
answer
224
views
Only allow rbash user to su
I want to have a user that has set rbash as its default shell to only use the command su. I have tried to create a folder "bin" in the home directory of the user and copied the binary su (/bin/su) ...
0
votes
2
answers
662
views
Cannot log in with SU on MacBook Air
Using MacBook Air with Mojave 10.14. While in Bash using terminal app, The SU command ask for password. When I put my user password in it says Sorry try again. My apple password does not work either.
0
votes
0
answers
892
views
sudo su ask target user's password
sudo su asks for invoking user's password as default sudo behaviour.
With Defaults rootpw it will ask root's password.
But is there a way, to make sudo su behave like su? Like it'll ask password of ...
-1
votes
2
answers
4k
views
SU Level Access Denied
I’m a newbie to Linux and have been over sometime setting up a NAS box based on an old Iomega NAS box modifying the installed software, mostly successfully. I haven’t done anything with it for over a ...
0
votes
1
answer
102
views
Executing command via sudo fails when multiple words
Running a command with two parts fails with sudo but not with su.
root@hello:/var/www/hello# sudo -u root "echo hello"
sudo: echo hello: command not found
root@hello:/var/www/hello# sudo -u root "...
0
votes
2
answers
3k
views
Running command via su as www-data user fails silently
I am trying to run a daemonised webserver as www-data user but I have reduced the problem down to the fact I can't even run the simplest of commands using su.
root@ubuntu:/var/www/hello# ls -la
total ...
1
vote
1
answer
629
views
Can't `su` to another user with login shell
I'm working on the Linux From Scratch project, and I've got a very basic problem I can't figure out.
I'm told to use su - lfs to change to my "lfs" user. If my understanding is right, the center dash ...
1
vote
1
answer
4k
views
Run command from sudo su
On a machine I (tlous) have been given access to open a shell as another user (serviceAccount)
Executing: sudo su - serviceAccount has the desired effect of opening a shell as this serviceAccount ...
1
vote
1
answer
1k
views
su another user through ssh with a local script
I have the following snippet:
ssh root@"${DO_DROPLET_IP}" -i "${SSH_PRIVKEY_PATH}" su www -c sh -c -- \
"./server-user-setup.sh" "${BB_USER}" "${APP_USER}"
which is inspired by the following (...
1
vote
0
answers
271
views
Cannot do su in CentOs
I have troubles with su on system that is attached to Active directory.
[user1@host_test ~]$ su - username
Password:
su: Permission denied
[user1@host_test ~]$
But i can access server with ssh
[...
3
votes
1
answer
376
views
LFS 8.2, cannot change user to root
I have a problem with my Linux From Scratch 8.2 system, because when I login as normal user and then try to switch to root using su command, it prints "Authentication failure" even after entering ...
1
vote
1
answer
544
views
Root user to execute a script without privilege but allow sudo commands to run without password
So as root (in /etc/rc.local) I want to run a script without root privileges say using su
su - myuser -c myscript
but in the myscript I want to run a command with sudo without giving a password. ...
3
votes
2
answers
19k
views
How to send sudo password in a shell script
My shell script (don't have EXPECT, and is not possible) runs a shell script impersonating another user. Let's say the following script is named toto1.sh and is run with a user called MYUSERNAME1.
#!/...
2
votes
3
answers
3k
views
Debain(buster) su not working properly, command not found
For example: I installed ifconfig
First i become root with "su"
Now I write "ifconfig" and get: "command not found".
I write "sudo ifconfig" and now it works.
This seems to happen with a lot of ...
0
votes
0
answers
324
views
How come a misconfigured /etc/resolv.conf affects su or ssh?
I have a Rhel 5 VM normally connected to an ldap service and today I discovered that ssh and su were broken. The shell would simply hang while trying either of these commands. I was only able to login ...
0
votes
0
answers
473
views
How does one add shell parameters while executing commands with su?
The situation.
I am debugging the environment of a restricted user who is relagated to a special shell. In order to do this, I need to run a command as that user in their full context using su like ...
9
votes
2
answers
126k
views
Switch user in Windows command line
Is there a similar Linux su command in Windows command line?
If not, what about:
in Powershell?;
a workaround with a *.vbs script?;
a workaround with some of the sysinternals tools like "psexec.exe"?
...
0
votes
1
answer
2k
views
How to start an interactive bash with su
I do not have sudo su over a username, however I have its password. I want to have an script that passes the password and gives me an interactive bash.
I have tried this:
echo mypassword | su - ...
0
votes
0
answers
328
views
How to switch to other user of same uid?
I created 2 users with the same uid/gid.
test:x:1000:1000::/home/test:/bin/sh
test1:x:1000:1000::/home/test1:/bin/sh
When I do su test1 and then whoami I get
test
How can I switch to user ...