Questions tagged [su]

command for substituting user i.e. logging to a session as a different user.

Filter by
Sorted by
Tagged with
0
votes
1answer
202 views

When sudo su vs sudo -i

I am reading some tutorials about Linux configurations: To accomplish many of the configurations is important and mandatory be the root. Well I did realize that in many places are used sudo su and ...
0
votes
1answer
258 views

su doesn't work from regular or sudoers

I'm trying to use su command to change my identity on ubuntu 18.04 But from neither regular user to sudoer user or sudoer to regular user it doesnt work! I get su: Authentication failure The sudo ...
0
votes
0answers
90 views

auto pass password to su (no sudo)

I am trying to pipe a password into su so that I can run su in a script and automatically give it a password. I am running this without sudo and attempting to su into root. I have tried this a few ...
-2
votes
1answer
157 views

Why does the su command does not work without sudo [duplicate]

I know it might seem lame but i was just wondering why do we need a sudo command to use su cmd to switch to root user.
2
votes
0answers
64 views

Why on Ubuntu 18.04 command “sudo -u username -s” not works as on CentOS 7? [duplicate]

I want to use a system user to separate permissions when I run nodejs scripts. I created node-user: sudo useradd -r -m node-user Then I expected that next command login me in shell node-user: sudo ...
0
votes
0answers
40 views

User Login Prompt runs in background when using with su `--login user` option

I am running ubuntu-19:10.When i type su - user after password input, it gives as [3]+ Stopped su - user. When i use fg command , I get login prompt for user. Why i have to type fg command every time ...
0
votes
0answers
14 views

Difference between su and sudo -s [duplicate]

I know the main use of each command (su and sudo), as I mentionned below : su is generally used to connect at a specifical user with su user command, alone, it lets us connect as root (and asking ...
1
vote
3answers
2k views

Permission denied creating directory after switching user

I switched to a different user with the su command, and now I want to create a file/folder but "permission denied" error appears. safi_test4@safi-VirtualBox:/home/safi$ su safi_test4 Password: ...
1
vote
1answer
245 views

Ubuntu script that runs commands after su - user

Ubuntu 18.04.3 LTS (GNU/Linux 5.0.0-31-generic x86_64) GNOME Shell 3.28.4 GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu) Typically, su - user is called in a terminal and the user then ...
1
vote
0answers
195 views

su {user} not working inside the ssh shell on the server

I am trying to connect to the server as root using ssh command in Ubuntu bash. I use ssh -p port root@ip to connect to the server and the config of ssh is a password-less connection ssh with the ...
2
votes
1answer
80 views

Installing windows 7 on virtual Box in my Ubuntu 18.04 [duplicate]

Helo there,, while am installing windows 7 on virtual box in my ubuntu is it a must that i have a flashdisk or i can just choose the iso file directly?
1
vote
1answer
77 views

Konsole starts in SU mode and asks for password in every window and tab

I am a bit of a newby and I have stumbled upon an annoying thing. Everytime I open a konsole, it is in su and asks for my password. I have searched around and tried all the things recommended on this ...
0
votes
0answers
30 views

Files saved on external drive with Ubuntu 14 have different permissions when displayed with Ubuntu 16

I saved my data on an external drive using a Ubuntu 14 machine. In that Ubuntu 14 machine, I can see in the following: david@david-Toshiba:/media/david$ pwd /media/david david@david-Toshiba:/media/...
1
vote
1answer
716 views

sudo does nothing and su doesn't accept my password

When I type sudo, the command doesn't seem to do anything useful. I expected to be asked for my password or to get a root shell, but instead I only get this: $ sudo usage: sudo -h | -K | -k | -V ...
-2
votes
3answers
2k views

How to elevate privileges to root in bash and return back?

How to elevate privileges to root in bash? And then how to return back to exactly the previous state? My question is both about elevating/decreasing privileges and possible troubles with some apps, ...
2
votes
0answers
307 views

“sudo su -” vs. “sudo -i” and /etc/environment

On an Ubuntu 14.04 host that I frequently update (apt-get update followed by apt-get full-upgrade) I have an /etc/environment file with some critical variables in it. Until recently sudo -i -u fred ...
3
votes
1answer
2k views

How can I install sudo without using su? [duplicate]

I need to use sudo but when I try to use it, a prompt tells me the command is not found and I need to install sudo. So when I switch to su so I can gain root access to install sudo, it says auth ...
0
votes
1answer
1k views

Using environment variables with su -c

I try to run nvm as a different user from a bash script. It is installed already and the NVM_DIR environment variable is set in /home/user/.bashrc: export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ]...
0
votes
0answers
54 views

Can't login to root account

I restricted the use of su by creating an admin group sudo usermod -a -G admin "admin user" sudo dpkg-statoverride --update -add root admin 4750 /bin/su Later I regretted this so I removed the ...
0
votes
1answer
733 views

sudo is not installed, both sudo and su are not working

When trying to switch to root using sudo su : Error- sudo is not installed When trying to switch with su command: Error- this program is not installed $ cat /etc/os-release NAME="Ubuntu" VERSION="...
0
votes
1answer
1k views

Can not root: after removing ZSH and returning to default bash

I can not $ sudo su everytime, I enter the command, the terminal says : can not execute /usr/bin/zsh no such file or directory How to return to default bash of Ubuntu and make bash as default ...
0
votes
0answers
40 views

SOLVED Switching user in automated scripts like cron jobs

If I run su -c "notify-send test" myusername as root, the command will be executed by myusername (me). But if I place a script in /etc/cron.daily or /lib/systemd/system-sleep and it is ...
3
votes
1answer
3k views

gpg: problem with the agent: Permission denied

GPG fails with gpg: problem with the agent: Permission denied when I invoke it after switching my user with su: su - user2 gpg --symmetric --passphrase=foo foo.txt If I invoke the command from my ...
0
votes
1answer
37 views

I can login using su in other accounts, but not using login screen

When I try to login to my administrative account using Ubuntu's login screen, I cannot. However, I can access other accounts and log in to them. Additionally, I can login to my account using su ...
1
vote
1answer
113 views

Prompt has been changed after upgrade to 18.04.1 after using “su” to change user

Just updated to 18.04.1 I use Terminal only. When I do an su to one my users that runs a game, I only get a $ and no name of the user and does not show current location. Also, tab autocomplete ...
0
votes
1answer
627 views

after su, the script stops working

we are running script the the first command in it is su (switch user) and after that other command: #!/bin/bash su sys_osrqa whoami pwd but when the script run, it asks for password, and after we ...
0
votes
1answer
251 views

Reset permissions on (K)Ubuntu 18.04: newly created user gets “Cannot execute /bin/bash: Permission denied”

so I seem to have screwed up some permissions on my Ubuntu desktop system. I wanted to let a newly created user only grant access to one single folder (to run in terminal only one app within that ...
0
votes
1answer
93 views

Cannot switch user - Error Code: 1

I'm in an interesting situation where I'm trying to log in to my headless Ubuntu instance in the cloud and I cannot switch to one of my users. Here's what I'm trying: login_id@cloud_machine:~> su ...
0
votes
0answers
39 views

Troubleshoot local printer with journalctl command with elevated privileges

Since root passwd is disabled i can't invoke su -c 'journalctl -u cups.service --since="None" --until="2018-07-03"' > troubleshoot-logs.txt I'm looking for sudo analogue
0
votes
1answer
4k views

su: Authentication Failure, stopped working

I recently installed Ubuntu 18.04. I used su command, entered my accounts password. It worked successfully for few times. Then I got Authentication Failure, now I'm not sure if I entered wrong ...
0
votes
0answers
20 views

Can't sudo unless I su as another user and then su back to my account? [duplicate]

user@greeneyes:~$ sudo apt-get install xdotool user is not in the sudoers file. This incident will be reported. user@greeneyes:~$ su verelse Password: verelse@greeneyes:/home/user$ su user Password: ...
0
votes
1answer
481 views

How do I run the install.sh file for this wi-fi adapter? I get “su: Authentication failure”

I have got a 600m wireless-n mini USB adapter from Realtek, model number OT-wua600nm. I'm trying to install through drive. I copy the file (linux) and paste into desktop and change the permissions ...
0
votes
1answer
712 views

Is it possible to run a command within a login shell using sudo or su?

I'm trying to run a non-interactive command within a login shell (using su - or sudo -i) but couldn't make it work so far. Within ~/.bashrc I have sourced a script which sets all variables my ...
1
vote
2answers
536 views

Set up sudo so that a particular common user can edit /etc/fstab

How can I set up sudo so that a particular common user can edit /etc/fstab? I've thought to edit /etc/sudoers.d file to do this, but how do we edit /etc/fstab in this file?
1
vote
1answer
61 views

After upgrade, rc.local now gives su must be ran from a terminal in rc.local

I have a few Ubuntu systems which use the su command from within the rc.local script. This updates a users git repo on the local machine, so its important that the ownership of files is kept to the ...
0
votes
1answer
6k views

writing a bash script that uses sudo [duplicate]

I am sure that this is a very basic question but I'm afraid that I have been unable to get it to work or understand what is going on. I have a node project that I usually run with sudo npm start ...
-1
votes
1answer
99 views

How can I access my files when I'm not logged in with my admin account (i.e. as a guest)? [duplicate]

I can no longer access my regular administrator account on my Ubuntu (see Ubuntu won't log me in with correct password) however I really need to access my files. I can only get on the PC with a ...
4
votes
1answer
2k views

Unable to enter superuser using su

Whenever I try to run su Password: Then it shows error setgid: Operation not permitted This problem arose after I changed permissions using chown Output of ls -lsa /bin/su is: 40 -rwxrwxr-x 1 ...
0
votes
1answer
165 views

Dell first boot failed, result in no session created

I just receive my brand new dell laptop wich is chiped with a pre-installed ubuntu-dell image. So I did the first boot to create my account and an "unrecoverable error" (or similar) occured and it ...
0
votes
1answer
1k views

How to alias pip to pip3 while using sudo for a specific user?

I have python2 and python3 both installed on Ubuntu 16.04, and use python3 primarily. I have both pip and python aliased to pip3 and python3, respectively, in my user's .bashrc. However, I had always ...
3
votes
2answers
4k views

How do I set environment variable for all users even when doing sudo su?

I created a file named x.sh in the directory /etc/profile.d/ so it should be accessible to all users. I expected when I change the current user in terminal (of logged-in user) using command sudo su ...
1
vote
1answer
416 views

Collecting user password via GUI in a script

I know that using the sudo and ssh tools it is possible to use GUI to ask for a password in a script by setting, respectively, the SUDO_ASKPASS and SSH_ASKPASS variables in which we specify a ...
0
votes
1answer
3k views

How do I become root when “su -i” is not supported? [duplicate]

As far as I know the following command is supposed to make me root: su -i Nevertheless, when I type it in Ubuntu 17.04 Zesty Zapus, I get the following message: su: invalid option -- 'i' Usage: su [...
-1
votes
1answer
1k views

How to run Ubuntu as normal user and switch to admin to change environment variables

I've just started learning Linux at uni, and my first homework is to: change current user to admin, do some stuff with environment variables, switch back to normal user I can normally log in ...
9
votes
2answers
2k views

Does sudo su create a child terminal?

This is what happened when I executed sudo su followed by exit $ sudo su # exit exit $ The exit command does not close my terminal emulator. Is it a child terminal?
0
votes
1answer
107 views

Changing wallpaper and language setting after su command?

Some time after su command I feel uncertain by seeing other wallpaper than the one corresponding to the new user. Is there any command usable at a batch, that I could use for quick switching that ...
0
votes
1answer
2k views

How to create service user for application and run it at startup from that user

I have an application, that I should run at startup. I created system user for that application with useradd -r serviceUser and made him the owner of application directory. Then I write startup ...
1
vote
2answers
73 views

Sudo and su simultaneously? [duplicate]

To switch between users sometimes sudo su newuser is used. What is meaning of sudo su together? Can anyone tell exactly how they both command together work?
11
votes
3answers
9k views

Best practices on using sudo in a bash script

I have a long and long-running bash script where a handful of commands need to be run as root while the majority of commands need to be run as the regular user before sudo, because it would mess up ...
9
votes
2answers
9k views

I can use sudo but I can't use su due to a password Authentication failure, shouldn't both be the same password? [duplicate]

when I try using a command with sudo everything works fine, however, if I want to log in as the superuser using su it doesn't let me. Why?