Questions tagged [su]

su is a utility to run a shell or other command as another user (root by default).

Filter by
Sorted by
Tagged with
0
votes
2answers
50 views

I'm not in “wheel” group, but I can “su -”

I don't understand. In BSD if I want to run su -, I have to add myself to wheel group. Is this not true in Linux? [test@centos ~]$ uname -a Linux centos 4.18.0-193.19.1.el8_2.x86_64 ... [test@centos ~]...
-1
votes
0answers
11 views

Accidentally Uninstalled “AndroidSystem” Black Screen After Splash Image [migrated]

A good friend hit uninstall on AndroidSystem icon (looks like a fan belt wrapped around a larger and a smaller circular object. AndroidSystem is the name of the icon). Since then, the tablet (a JP5s ...
0
votes
0answers
21 views

SSH session gave a false negative when adding user to wheel [duplicate]

Specifications RHEL version: Red Hat Enterprise Linux release 8.2 (Ootpa) Kernel version: 4.18.0-193.14.3.el8_2.x86_64 The issue I was facing Yesterday I started a SSH session to a RHEL8 machine, ...
2
votes
0answers
42 views

Solution: How come that lxc-attach doesn't work within su -c?

I have an unprivileged lxc container. It works well and if I need to do something within that container, I su --login lxc-user, then I do lxc-attach -e -n lxc-container for e. g. doing updates ...
0
votes
2answers
72 views

How do i make a program run with elevated privileges but not as root?

I am testing CTF like thing in my laptop and i have option to upload a PHP file which when executed grants shell to uploader, (reverse shell), however there is a problem. When i do su - www-data cd /...
0
votes
1answer
61 views

Executing sed throws the error “unexpected EOF while looking for matching”

Here's the problem. I'm trying as "root" user to execute a command as "myusername" user. That's why I'm using su - $USERNAME -c <command> The <command> itself is ...
0
votes
0answers
36 views

Why is “sudo su” slow without ALL=(root) in /etc/sudoers?

I have had this weird issue on a SLES 12 Server. Info: We have lots of application users like for example applusr01, applusr02, ... We have a special user which has sudoers rights to run commands as ...
1
vote
1answer
48 views

Right way to use su and a specific command?

When I need to, I've always done things like su root cmd args to run cmd as root with args. The man page used to say something about how it invoked your cmd using the target account's shell and -c, ...
0
votes
1answer
83 views

why cant I sudo cd into /root [duplicate]

when I run sudo cd /root it says sudo: cd: command not found but it works perfectly fine if I first sudo su and then do cd /root. Isn't sudo supposed to give me root privileges?
1
vote
1answer
35 views

zsh prompt losing customization when using `sudo su`

My current zsh prompt is: prompt='%F{013}%2~%f$(git_super_status)%(?.%F{004}.%F{001}✕%?)$ %f' It looks something like: Documents/multi-git-status:master↑5●2✚1…$ However, when I use sudo su it ...
0
votes
1answer
38 views

What are the differences between “sudo -s” and “su root”? [duplicate]

What are the differences between "sudo -s" and "su root"? As they both can provide root permission.
0
votes
1answer
19 views

login with “su john” command does not source john's .bash_profile [duplicate]

The .bash_profile for user john is not taking effect when I (as root) use the su john command to login as john. I have to use source ~/.bash_profile command every time I login as john using the su ...
2
votes
2answers
2k views

Error: su: must be run from a terminal

When I try to login to root user using shell script given below, it throws an error: su: must be run from a terminal The srcipt (scriptfile.sh) looks as follows: su -s <<EOF echo Now i am root ...
0
votes
0answers
117 views

systemd — su: Permission denied, in /etc/init.d scripts

We are migrating from RHEL6 to RHEL8 and I would like to retain the old /etc/init.d scripts, since we have a ton of applications that would otherwise need be rewritten and tested. For many init-...
0
votes
0answers
20 views

Ubuntu always change user

I have no idea what is the topic of my problem. I have to change the user using su user when accessing the server with ssh user@server The initial terminal shows just > without a user name (i.e., ...
0
votes
0answers
30 views

What happened to “su” command in CentOS 8?

I'm considering to change the user running old java programs from root to a system or normal user with low privileges, but something wrong happened with the logs permissions. The permission of logs ...
0
votes
1answer
144 views

How can I run su root and enter credentials in a script?

there's a script that I have and it needs to be run by root user. I just wanted to know how to run that script using su in the script. - I'm running CentOS7. The command I attempted (below) failed: ...
2
votes
0answers
44 views

Disable root password, and eliminate sudo, on system that will only ever be orchestrated remotely?

The system in question will only ever be managed remotely using Ansible and so I'm not concerned about limiting catastrophic commands from a group of users or allowing convenient administrative access....
0
votes
2answers
93 views

Why doesn't “usermod” work under superuser?

The usermod command successfully through sudo. sudo usermod -aG some_group some_user However, if you execute it through su, then there will be an error. su ...I enter root password... usermod -aG ...
2
votes
2answers
134 views

su: Permission denied (credentials correct)

There are a lot of questions with similar titles. I believe I have checked them all before asking this question. My error is su: Permission denied and the user switch is not completed. Here are the ...
4
votes
3answers
460 views

iptables rule to unblock internet acess, and block it again 3600 seconds later

I do this, from my son's terminal, to sometimes give him internet access (disabled by default): ./unblockinternet.sh <enter password> with this script: su -c "iptables -D OUTPUT -m owner --...
0
votes
1answer
133 views

Why whoami always returning “root”?

After a hack, a dedicated server always return "root" following whoami command. Even after a sudo su myUser > whoami return "root". myUser exists on the server, because regarding this issue passwd ...
2
votes
2answers
113 views

How to do this su + sudo in one command?

My son (not sudoer) is logged-in, and from his terminal, I sometimes want to iptables to remove the internet blocking (which will be back again after reboot ;)). son$ su dad <enter password> ...
0
votes
1answer
54 views

Fedora fails to start and lost shell access

Linux Dist: Fedora 31 Mate compiz. Dual boot with win10. (UEFI secure boot enabled). 1) While shutting down the system, an unusual errors showed up in the screen. So the problem started with Lightdm....
3
votes
1answer
2k views

Why `su` gives “su: Authentication failure” even when running as root?

Somewhat like in How to suppress su authentication failure warning?, but it actually does not run the command at all. # su limited su: Authentication failure # su -s /bin/bash limited su: ...
-1
votes
2answers
67 views

Which one is safer? sudo dnf update OR su - ; dnf update

Is it safer to do: $ sudo dnf update [enter user password] or $ su - [enter root password] # dnf update I always assumed they are the exact same thing, because sudo utilizes setuid-root, so the ...
1
vote
1answer
110 views

BASH Script running as root, tidy way to group commands run as another user?

I'm aware that i can run each command as a different user with: su -s /bin/bash "command" - user But there's several commands to run and i was looking for a neater way to do it than putting su on ...
0
votes
1answer
65 views

Able to do su into a newly created account but direct ssh is not working

I need some guidance here. I have created a new account on the Linux server and encountered a weird problem. The new account is not able to log in and can't even ssh test@localhost I am able to ssh as ...
1
vote
1answer
59 views

Difference between su vs sudo [duplicate]

What is the difference between the two commands? Which one is better to emulate another user when wanting to do something as that user? sudo -H -iu USER command and su -l USER -c command
0
votes
1answer
76 views

'su user' behavior differs when logged in locally vs via ssh

On my Ubuntu 18.04 system, there's a user called myuser without a password: tester@box:~$ passwd -S myuser myuser NP 03/31/2020 0 99999 7 -1 When I log in to the machine locally and switch to myuser ...
0
votes
2answers
59 views

How to solve the issue where nano screen text is scrambled when using su - admin

In Terminal I su - admin while in my user account to brew update, modify .bashrc, etc. I have noticed that when in my user session changing the size of the window while running nano doesn't scramble ...
1
vote
1answer
68 views

sudo -u “user” --login vs. su “user” --login

I think there is slightly differencess between sudo -u "user" --login and su "user" --login For instance, I create a user with useradd -m user and ran passwd -e which means the user user's ...
0
votes
0answers
28 views

`su -c “command” user` fails while command succeeds

this command fails when it is being run by a user that is different from myuser and having sudo rights: sudo su - -c "export KAFKA_OPTS=-Djava.security.auth.login.config=/etc/kafka/conf/kafka_jaas....
2
votes
1answer
599 views

How to install sudo, when I don't have sudo or su

I'm operating within a Kong API Gateway Docker container, and am trying to install some basic package handling. Ultimately, I need to be able to use sudo. The Docker image comes with only busybox bin ...
0
votes
1answer
37 views

Making wheel group membership sufficient for su on SLES 2015

I'm using SLES 2015. I want to make membership in the wheel group sufficient for root-privilege access via su. From Debian distributions, I'm used to uncommenting the command: auth sufficient ...
0
votes
1answer
83 views

Why is pam_env.conf ignored after I su into root user?

I'm trying to do: su -l and set environment variables like PAGER without success. How can I achieve this? This is what I have in /etc/pam.d/login: auth required pam_securetty.so auth ...
2
votes
1answer
84 views

Why does su ask for a password if stdin is redirected? How do I avoid this?

I'm using su (not interested in sudo for the purposes of this question) and observing the following behavior: $ su USER -s /bin/bash -c "echo hi" hi $ printf "" | su USER -s /bin/bash -c "echo hi" ...
0
votes
1answer
519 views

How to get the command line history of another user?

I currently have a server set up to save Bash history for every user immediately in their respective home folders and I want to create a script that runs on a set interval that switches the current ...
1
vote
1answer
136 views

Can a process send keystrokes or read text to/from a tty that is running su/sudo?

I need some information regarding the possible attack vector on *nix platforms of running su/sudo. Can an malicious process wait for the user to run su or sudo and then exploit that root access ...
0
votes
0answers
62 views

Getting strange error when trying to login through “su user”

When I'm login as root, all is fine, but when I'm trying to log in directly with user or "su username" command I'm getting this. Does anyone have thoughts about why this might happen? (1:43)# su ...
0
votes
1answer
44 views

How to copy file to another user (have password, no root)? [duplicate]

I am user_a and I have a password for user_b, so I can use su user_b to do things as user_b. I want to copy a file from user_a to user_b. I don't want other users besides user_a and user_b to see ...
0
votes
1answer
91 views

Why does su command ignore SIGSTOP?

After entering su when I prompted to enter a password: user@debian:~$ su Password: I can't send SIGSTOP (ctrl+Z) from my keyboard (the same terminal) - nothing happens. So the only way to exit is to ...
1
vote
1answer
128 views

Why does my su start in background?

When I use su - fred the job is immediately moved to the background. Then, if I use fg it works normally: wally@Machine:~$ su - fred Password: [1]+ Stopped su - fred wally@Machine:~$...
0
votes
0answers
86 views

Running commands with www-data privileges in scripts, crontab and systemd

I've already read "Allow www-data to perform specific commands" article. But, crontab and systemd invokes scripts using root privilege. # my-service.service [Unit] Description=My Service [Service] ...
0
votes
2answers
432 views

Why cannot I become root via `su`?

Why doesn't su work but sudo -i does? When I want to become root via su, the system doesn't accept my password, but via sudo -i it works. su: Authentication failure
1
vote
0answers
45 views

Solaris 11.4 RBAC works for vim, not for su

I want to access some commands as root, for a normal user. I create the profile profiles -p "privileged" set desc="privileged profile" add cmd=/bin/su set euid=0 end commit exit Then I add profile ...
0
votes
1answer
334 views

-bash: ifconfig: command not found when using `su - redbox -c 'ifconfig'`

I am logged in as root user and need to execute a single command from redbox user without switching. For this, I am using following command: # su - redbox -c 'CMD'. When I try to execute "ifconfig" (...
0
votes
0answers
139 views

su -c no such file or directory on Android 9 aarch64

I have a rooted android phone use Lineage OS 16 (based on android 9). Architecture is 64 bit. There is a file called andraxzsh which has the code su -c /data/data/com.mytestapp/APPS/bin/bash ...
2
votes
1answer
355 views

Debian 10 su command to existing user as root without password

I just installed a brand new VM with Debian 10 (buster) and joined it to our active directory using pbis. what I encountered now is, that: as the root user, I can su to every other available user ...
0
votes
1answer
298 views

Can't access some commands when logged in with non-root user (even after “su root”)

So, i don't understand whats happening here. I've set up a Debian 10.2 Server and configured like i did before with other Servers. Everything works fine, and because it's a local Machine and i am ...

1
2 3 4 5
10