switch as another user without password

I want to switch as another user without using password .Is it posiible ? I have one server B and I have logged in as username u1 but I want to login to that same server using username as u2 but I don't want to give the password for u2.

What OS - there ae commands like pfexec, sudo, su that can do that for you

If sudo is installed, you could sudo su - u2 . Appropriate config entries in /etc/sudoers would be required of course. These can only be edited by root though.

Some random thoughts....

Do you have to log in as user 'u2'? Can you do what you want with groups?

Can you use owner or group set UID / GID on an executable?
Could you use SUID and sudo on an executable?

If not, another vote for sudo.

What do you want to do as user u2?