Timeline for How to switch between users on one terminal?
Current License: CC BY-SA 2.5
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 27, 2020 at 14:23 | comment | added | Hi-Angel | Worth noting: while sudo -u user … works fine on Archlnux, however on Ubuntu 18.04. It gives the wrong home directory, e.g. echo ~ gives root dir for me. Using su - user works fine however. | |
| Mar 20, 2019 at 4:46 | comment | added | Hopping Bunny | I am slightly off the topic, but mentioning this in case you or someone else can use it. Assuming that you are using a modern OS and have tmux installed (or can install it), one way would be to: 1. Login to the host. 2. Launch a tmux or screen session. 3. Split the pane or open one or more windows as needed. 4. Sudo as the other user as mentioned by others here. 5. Switch back and forth between the users. You need not logout of any session to switch users. Please lookup tmux for shortcuts that can help you save a lot of time.HTH. | |
| Mar 15, 2019 at 12:19 | comment | added | max4ever | if you get "This account is currently not available": su -s /bin/bash - www-data | |
| Dec 26, 2015 at 11:47 | comment | added | will | One finding, when I listed the env it saw that everything was in order as well as a visual inspection can go; And one thing was incorrect: XAUTHORITY=/home/user1/.Xauthority'. Not sure _why_? So X-window doesn't work by default because the protection on ~/.Xauthority` file is: -rw-------. I made a copy and that let me run gedit as an experiment. | |
| Dec 23, 2015 at 21:13 | comment | added | Kevin Suttle | Does this allow each new user to have different, overriding values for environment variables? e.g. git config for work, open source, etc. | |
| Nov 24, 2014 at 18:58 | comment | added | Aquarius Power | I am getting this error "-su: /dev/stderr: Permission denied" after executing this command echo >>/dev/stderr on a login with su --login ..., any tip? I found this btw unix.stackexchange.com/questions/38538/… | |
| Sep 5, 2014 at 20:15 | review | Suggested edits | |||
| Sep 5, 2014 at 20:21 | |||||
| Jan 15, 2014 at 4:18 | review | Suggested edits | |||
| Jan 15, 2014 at 4:42 | |||||
| Jan 10, 2011 at 21:48 | history | edited | tshepang | CC BY-SA 2.5 | merge the other asswer into this one |
| Oct 27, 2010 at 20:40 | comment | added | ephemient | Also, su - [user] may be useful -- the extra dash gives you a login shell. | |
| Oct 27, 2010 at 20:00 | vote | accept | tshepang | ||
| Oct 27, 2010 at 19:58 | history | answered | Pratt | CC BY-SA 2.5 |