I only know the UID of a user, is it possible to switch user using UID in CentOS like we do using username like su -u someuser?
Look up the username with the
id command, e.g.:
id -un 1003
Then put it together with command substitution:
su - $(id -un 1003)
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.