Secure your private gpg and ssh keys from other people accessing ssh

view story

http://askubuntu.com – There is a person A and person B, other of them has each other ssh public key, so that means they can access each others shell. now they can access each others private ssh and gpg private keys. and they can easily export and them the private keys to themselves. is there a way that they can not access these keys or not able to export them. Is there a way to restrict them from accessing each other ~/.gnugp and ~/.ssh folder Thanks in Advance (HowTos)