Jonyboy
New Member
Hi all I have this script and one of the commands is
This allows the user guest to login to my account on the command line and execute the command "/home/guest/script". The user "guest" has to type in my password.
I was wondering how to use an if/else statement to say whether or not the user succeeded.
I want it to say incorrect password
or
Permission granted
but don't know how to capture the user input whilst they type in the password when "su - jonathan" asks for it.
Thanks
Code:
su - jonathan /home/guest/script
This allows the user guest to login to my account on the command line and execute the command "/home/guest/script". The user "guest" has to type in my password.
I was wondering how to use an if/else statement to say whether or not the user succeeded.
I want it to say incorrect password
or
Permission granted
but don't know how to capture the user input whilst they type in the password when "su - jonathan" asks for it.
Thanks