Fix bug in user detection for ssh_gateway