New answers tagged


I needed something similar for ssh, scp etc. for a server which keeps changing IP every couple weeks (and our IT has a couple weeks delay in setting the host). I solved it using a special variable for this server: export FOO=' and then I can do just ssh bar@$FOO and I change the IP in my ~/.bashrc any time it changes...


Try something like that $ export LOGIN_USER="Math" $ su - $LOGIN_USER $ sudo xhost local:$LOGIN_USER &>/dev/null source Ps: the accepted answer not worked for me


On Ubuntu you can use just sudo -u deploy $DAEMON $DAEMON_OPTS


I've been using the form username ALL=(ALL) NOPASSWD: /bin/su targetuser

Top 50 recent answers are included