Skip to Content

Privileged access management in Linux

How to login to a remote server as a non-privileged user and escalate privileges in SSH?

These two methods will allow the Ezeelogin gateway user to login to a remote server as a non-privileged user and then switch to the root user without prompting for the password.

Method 1: SubSSH User

1. Login to the Ezeelogin GUI and create a SubSSH user. This will create a non-privileged user on the remote servers.

2. Map the SubSSH user to the Ezeelogin gateway user.

3. Login to the remote server and add the SubSSH user to the sudoers file. This will enable the non-privileged user to switch to root without being prompted for a password.

root@remote_server ~]# visudo

alex ALL=(ALL:ALL) NOPASSWD: ALL

4. Login to Ezeelogin, then access the remote server and switch to the root user.

Method 2:  Pass User Through

1. Login to the remote server, create a user with the identical username as the gateway user, and either provide the same password or enable key authentication.

root@remote_server ~]# adduser tony

2. Edit the gateway user and change Pass User Through to Yes.

3. Login to the remote server and add the Pass user to the sudoers file. This will enable the non-privileged user to switch to root without being prompted for a password.

root@remote_server ~]# visudo

tony ALL=(ALL:ALL) NOPASSWD: ALL

4. Login to Ezeelogin, then access the remote server and switch to the root user.