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.
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 ...
You can try using
su - username
to switch to the desired user.
You can find additional documentation about the suteam here.
su
You should probably research sudo.
sudo
sudo :
echo "p@sw0rd" | sudo -S cal -y 2011
"cal -y 2011" root.
, login ( su), , login root. , , -f.
login
-f
man : http://www.manpagez.com/man/1/login/
man
, , ssh, ssh ... expect script .
ssh
expect