Switch user MAC terminal

Can someone help with a simple question. I need to log in / switch the user on the command line in 1 line; For example: login -p username ? password.

What should I write in '?' position? Because I need to log in to a script that does not know the password of the system ID ...

+5
source share
4 answers

You can try using

su - username

to switch to the desired user.

You can find additional documentation about the suteam here.

+6
source

You should probably research sudo.

+1
source

sudo :

echo "p@sw0rd" | sudo -S cal -y 2011

"cal -y 2011" root.

+1

, login ( su), , login root. , , -f.

man : http://www.manpagez.com/man/1/login/

, , ssh, ssh ... expect script .

0

All Articles