2022 Developer Survey is open! Take survey.

Questions tagged [su]

The "substitute user" Unix command that changes the current user

Filter by
Sorted by
Tagged with
1 vote
2 answers
52 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 ...
user avatar
  • 113
0 votes
1 answer
34 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 ...
user avatar
0 votes
1 answer
29 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 ...
user avatar
0 votes
1 answer
36 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?
user avatar
0 votes
3 answers
113 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 ...
user avatar
  • 1
0 votes
0 answers
38 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 ...
user avatar
  • 141
1 vote
0 answers
2k 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 ...
user avatar
0 votes
1 answer
81 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 ...
user avatar
0 votes
0 answers
116 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 ...
user avatar
0 votes
1 answer
252 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 ...
user avatar
1 vote
2 answers
228 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@...
user avatar
0 votes
2 answers
28 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 ...
user avatar
  • 101
0 votes
1 answer
51 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 ...
user avatar
1 vote
0 answers
124 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 ...
user avatar
  • 11
0 votes
0 answers
88 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 ...
user avatar
1 vote
1 answer
31 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 ...
user avatar
0 votes
1 answer
274 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 ...
user avatar
0 votes
0 answers
139 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 ...
user avatar
  • 127
0 votes
1 answer
152 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, ...
user avatar
  • 123
1 vote
0 answers
22 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 ...
user avatar
0 votes
1 answer
195 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 ...
user avatar
  • 317
0 votes
1 answer
73 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([...
user avatar
  • 165
0 votes
1 answer
257 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 ...
user avatar
  • 1
8 votes
6 answers
3k 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: ...
user avatar
0 votes
1 answer
73 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 (...
user avatar
0 votes
1 answer
173 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) ...
user avatar
  • 21
0 votes
2 answers
318 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.
user avatar
0 votes
0 answers
344 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 ...
user avatar
  • 127
-1 votes
2 answers
2k 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 ...
user avatar
0 votes
1 answer
63 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 "...
user avatar
  • 213
0 votes
2 answers
2k 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 ...
user avatar
  • 213
1 vote
1 answer
529 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 ...
user avatar
  • 51
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 ...
user avatar
  • 113
1 vote
1 answer
733 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 (...
user avatar
  • 123
1 vote
0 answers
154 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 [...
user avatar
  • 125
3 votes
1 answer
312 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 ...
user avatar
1 vote
1 answer
494 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. ...
user avatar
  • 193
1 vote
2 answers
12k 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. #!/...
user avatar
  • 11
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 ...
user avatar
0 votes
0 answers
261 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 ...
user avatar
  • 1
0 votes
0 answers
390 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 ...
user avatar
6 votes
2 answers
78k 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"? ...
user avatar
  • 181
0 votes
1 answer
1k 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 - ...
user avatar
  • 334
0 votes
0 answers
184 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 ...
user avatar
  • 101
1 vote
0 answers
111 views

AD integration in RHEL 7 without Kerberos

How to integrate with AD in RHEL 7 without kerberos? I have below in /var/log/secure. Mar 12 09:57:31 xxxxxxxx su: pam_sss(su-l:auth): authentication failure; logname=admin uid=86500 euid=0 tty=pts/0 ...
user avatar
55 votes
2 answers
6k views

Where did the term "superuser" originate?

Where did the term "superuser" originate? Is it a shortening of "supervisory user", or is it just an indicator of the level of power one such user holds in a system?
user avatar
  • 1,164
0 votes
1 answer
154 views

Block su without the '-'

I want to block everyone running su without the login option. They can run su - <user>, su -l <user>, su --login <user>. But su <user> will be blocked. How to achieve this?
user avatar
  • 127
0 votes
1 answer
2k views

what does sudo su - s option means

I have used 'sudo su -' many times and I know what it does actually. I wanted to know what does this mean --> 'sudo su -s /bin/bash userid' I googled and iam not able to identify what i actually need....
user avatar
  • 1
4 votes
1 answer
3k views

Rewrite a call to su-exec with su or similar?

In this bash script under Linux Alpine they have (line 8): exec su-exec "$ZOO_USER" "$0" "$@" As far as I know, su-exec is however an Apache httpd dependecy - can I avoid it installing it under ...
user avatar
  • 451
0 votes
0 answers
88 views

screen command called from within a script, within a "su -c" command creates files on root directory

I'm executing this script from user root in directory "/": su -c "sh /home/bob/start_server.sh" bob and "start_server.sh" contains screen -d -m -S serverscreen mono startserver.exe However all the ...
user avatar