How can i su automaticaly in same server with different username and same password?

Hi I am new to shell scripting,
Can you please help me in writing a script that can switch user in same server with different user name and same password.
I want to perform some functional task in a particular user and need to switch user and perform same activity in another user and so on ...

Thanks in advance

What I dont get is the "same passwd" and writing a script ... How do you think you will get the password to be read? Are you talking of a sofware like Oracle ( which accepts ) or true UNIX su?
My understanding is if itwere for some batch launched by cron then as root it can be done and you care not about password...

check SSH

I want to give password at first time and after that it should not ask for password for different username as password will be same for other users that i already given at first SU

su does not work that way. Period.

ssh can work that way if you arrange for key based authentication and explicitly tell it to forward the key.