I Have created a shell script as given below.This script will login to a remote server as a normal user then switch to root user for creating a directory.The script is as given below.
ssh -t firstname.lastname@example.org '
su root -c "
echo \"Give Directory name :\";
Here the script will ask Password for normal user first.Then again it will ask for root Password.How could I automate this using
expect command.I want to supply the password automatically for the root user only.I think it can be done with
Please do help me.