I have one server X, and having 2 user accounts A and B. How to give user access B to user account A.
As ctrl-d said, my first thought would be have them (userB) create a ssh key, and add it to your (userA) .ssh/authorized_keys file. This would allow userB to "ssh usera@host" without knowing the password, without the password being stored insecurely, and would not be affected by userA changing passwords.
You can also restrict them to running a single command, if they only need access for a specific purpose using command="command-to-allow" in the authorized_keys file.
I will probably get flak for this since it seems to be somewhat controversial, but if you want the two users to be identical as far as the system is concerned, you can edit
/etc/passwd to give them both the same UID. The UID is what the kernel uses to determine file access rights and other privileges: it doesn't care about your username.
This can have same strange side effects, though, so use it only if you know what you're doing.
I encourage you to read the answers and comments at Why can I create Users with the same UID?