How can I sudo su and change directory just after?
alias userYYY='sudo su userYYY -c "cd /a/path/that/only/userYYY/has/access; /bin/bash"'
One option would be to edit ~/.bashrc
of the target user, and add cd
there:
cd /a/path/that/only/userYYY/has/access