Linked Questions

3 votes
1 answer
17k views

I saw some command such as sudo su ls, and I just wonder what's the deference between sudo ls?
Peco's user avatar
  • 161
7 votes
2 answers
1k views

It might be a duplicate and I'm pretty sure I already saw an answer to this somewhere, but I wondered what are the differences in terms of rights and variables and other stuff between sudo -s and sudo ...
Kiwy's user avatar
  • 9,892
55 votes
7 answers
125k views

I basically need to do this: DUMMY=dummy sudo su - ec2-user -c 'echo $DUMMY' This doesn't work. How can I pass the env variable $DUMMY to su? -p doesn't work with -l.
Umang's user avatar
  • 653
45 votes
3 answers
138k views

I created special user in /etc/passwd with: secure:x:2000:2000:secure:/bin:/usr/sbin/nologin I don't want to allow login of this user (via console, ssh, ftp, any way). He is just for running one ...
peter's user avatar
  • 1,005
8 votes
5 answers
103k views

I have some downloads in my root user /root/Downloads folder. How can I access them from another not-root-user account?
Program-Me-Rev's user avatar
9 votes
1 answer
35k views

I installed zsh and changed root shell /bin/bash to /usr/bin/zsh. Then I rebooted and typed sudo su. It said "Cannot execute help: No such file or directory". So, I typed sudo bash. However, when I ...
user avatar
11 votes
5 answers
11k views

I see a lot of posts out there that say you type in sudo su to get an interactive prompt with root privileges, and I see equally many posts debating the pros and cons over sudo -i vs sudo su. Here I'...
Electric Coffee's user avatar
9 votes
2 answers
2k views

I wrote a script which switches users while running, and executed it using file redirection to standard in. So user-switch.sh is... #!/bin/bash whoami sudo su -l root whoami And running it with ...
devoutsalsa's user avatar
5 votes
1 answer
13k views

My user is part of the admin group and I'm used to type sudo su to impersonate root. Unfortunately this generate a non-login shell and if I need one I need to type again /bin/bash -l. Is there any ...
Ignazio's user avatar
  • 231
2 votes
2 answers
16k views

This question is answered a number of times in the net, but none of those answer resulted useful in my case. The problem Accessing a remote machine using private key, I usually require root ...
Adrian Maire's user avatar
  • 2,062
5 votes
3 answers
3k views

I am trying to make sure when a script is run it is run as a specific user without having to su to that user before the script is run. Also the script is run with a couple of flags for example ./...
PDStat's user avatar
  • 153
1 vote
2 answers
5k views

I want to create a ssh key, I wanted to know does it make any differences when I create the key as root and when I create it as user? like as a user I do this: ssh-keygen -t rsa -C "your_email@...
Ladan Nekuii's user avatar
1 vote
2 answers
11k views

I using Redhat linux. I am trying to run the following command and would like to know why it is not prompting for password? Here is what I am doing. I open the terminal window and enter my username ...
jbl's user avatar
  • 11
5 votes
2 answers
6k views

The following happened to me: $ sudo su - superman Sorry, user clarkkent is not allowed to execute '/bin/su - superman' as root in krypton101. However the following worked fine: $ sudo su superman ...
usual me's user avatar
  • 151
1 vote
3 answers
6k views

I want to continue the execution of the script after change user, the script would be something like below echo "xauth add" `xauth list | grep ${DISPLAY:10:2}` >> test.sh sudo su ./test.sh ...
karra's user avatar
  • 11
0 votes
2 answers
7k views

I can use RSA keys to putty into my centos VPS with no problem. And from there I can use sudo to run commands. But my root password is not working. I wonder if I hosed something while setting up ...
Skippy VonDrake's user avatar
4 votes
1 answer
16k views

Added: After reading suggested as duplicate Which of proc, sys etc. should be bind-mounted (or not) when chrooting into a "replacement" distribution? : How I know: it is customary to invoke ...
Alex Martian's user avatar
  • 1,319
3 votes
1 answer
9k views

I have typed sudo su in the Terminal, and then I typed whoami, and the Terminal said that I am the root user. So does that mean that sudo su makes me the root user or am I missing something?
user226756's user avatar
2 votes
2 answers
2k views

Not sure what I'm doing wrong here. User2 sources a file in it's .bash_profile to set environment specific aliases. # .bash_profile source $HOME/set_environment_shortcuts Inside $HOME/...
Motorahead's user avatar
3 votes
1 answer
4k views

I'm running centos7. I installed puppet. if I write puppet as a user, I get a proper output. If I write sudo puppet I get command not found. The really weird thing is, if I do sudo su - and become ...
iamAguest's user avatar
  • 553
2 votes
1 answer
2k views

I am working on standardizing the sudo access in our environment. To begin with, I am understanding the current setup. Currently, we use sudo bash to get into the root shell without typing any ...
Ram Kumar's user avatar
0 votes
1 answer
1k views

Assume we have two users: user1 (an admin) and user2 (a standard user) Login as user1 Run sudo su - user2 -c "env" The result shows $HOME=/home/user2 Run sudo su - user2 -c "echo $HOME" The ...
thn's user avatar
  • 3
-1 votes
2 answers
3k views

I created a (system) user, eg: mysysuser, and some sudo rules so it can do some maintenance in other users folders. This script needs to run as other user but also needs some parameters. Therefore, ...
chichi's user avatar
  • 1
0 votes
1 answer
2k views

I can login as any user, but not as a root user in centos 7. When I type the command su and enter password ,it gives me login incorrect message. What could be the issue?
Nishmitha's user avatar
1 vote
1 answer
2k views

I have a use case where I want to sudo su - user1 to some user and then run script and in the script I want to fetch SUDO_USER. However the SUDO_* environment variables do not get set when I use sudo ...
Rohit's user avatar
  • 111
3 votes
1 answer
471 views

On Linux Ubuntu when at terminal I run sudo su or sudo su - the system creates a new session with a new controlling pts, namely ubuntu@ubuntu:~$ lsb_release -a No LSB modules are available. ...
CarloC's user avatar
  • 385
0 votes
0 answers
1k views

We are thinking of using a batch file as shown below for our software deployment. While we don't need high security we are still wondering if there are obvious security issues with this approach. @...
Joe's user avatar
  • 143
0 votes
1 answer
734 views

I want my server to not allow root login. For this I want to set the PermitRootLogin to No (in the SSH daemon config), but before doing that I want to make sure I can switch to root from another user ...
user3105533's user avatar
1 vote
1 answer
287 views

When I log in as root and enter some random non-existing command, it says: root@localhost:~# asdf -bash: asdf: command not found root@localhost:~# But when I do the same thing as user rakinar2 it ...
Ar Rakin's user avatar
  • 199
0 votes
1 answer
468 views

Currently I am running a server on vnc with RHEL 7 operating system. Background: I login to the server say kpod@server1 Now when I need to access root permissions. I use the path /tools/xgs/bin/sudo ...
Kamalikap's user avatar
0 votes
0 answers
423 views

I am trying to SSH a remote machine and change user to root and run a series of command which need root I tried the command below but seems it's not working sshpass -p <pwd> ssh -q -o ...
hellojoshhhy's user avatar
0 votes
1 answer
182 views

I want to perform the set of actions inside a different user while running my script, so i am using HEREDOC to perform such actions, but no matter alternatives i try, i cannot able to reference my ...
Alapati Srikanth Chowdary's user avatar
2 votes
0 answers
520 views

The problem: I'm trying to run Ansible on a Mac to remotely configure a linux (ubuntu) server that requires MFA access for sudo usage. My goal is to keep the MFA in place (as required by our security ...
twoLeftFeet's user avatar
-2 votes
2 answers
154 views

I tried to set an environment variable for the Sublist3r tool and messed up. Now whenever I switch to the root user (with sudo su) the only command I am able to use is exit (attaching the images). I ...
Vini sharma's user avatar
1 vote
1 answer
218 views

Working on Ubuntu (but I doubt it matters). Our Unix servers are set up so users (read admins) have to login to their personal accounts. If you need to work as an other (say application user) you ...
Russell Fulton's user avatar
0 votes
0 answers
126 views

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....
bpgergo's user avatar
  • 177
1 vote
1 answer
99 views

Are: sudo -i and su - functionally the same, both should give fresh root shells with root's environment right? If so are sudo -s and su the same? Thanks
Woodstock's user avatar
  • 458
-1 votes
3 answers
219 views

I want to SSH into a remote server (Amazon Linux 2) and simultaneously execute su and some commands, while also maintaining the SSH session in a single script like this: ssh -t ec2-user@$host -i $...
tom's user avatar
  • 21