Skip to Content

User identity and access management in SSH

How to login into the remote server with the same username as the ssh gateway user?

There might be situations where the SSH gateway users need to login to a remote server with the same username as on the SSH gateway user.

For example,

How would you ensure that your ssh gateway user 'tony' would always login into the remote server as the system user 'tony' on the remote server?


Method 1.  Pass User Through 

Refer to the following article on Pass-through User.

You would need to ensure that a user with the same name as the jump server user exists on the remote server.


Method 2.  Sub SSH User

Here is how to ensure that the SSH gateway user 'tony' would SSH into the remote server and login as the system user 'tony' on the remote server which belongs to the server group Linux cloud instances.

Note: Make sure to use the Password Management as "Automatic" or " Keep given password", or else the user won't be created on the remote servers that being added after creating sub ssh user. 


You can also establish a subordinate SSH user using a non-privileged user allowing a gateway user to log into the remote server as a sub ssh user. 

Refer to the article for more details: Create sub ssh user with non-privileged remote ssh user

1. Create the SSH gateway user 'tony'.

2. Create Sub SSH user called 'tony'. This step would create system users by the name 'tony' across the servers added in GUI. If the system user 'tony' already exist on the remote server, then select unmanaged while adding the system user.

You can edit the password and SSH private key of the unmanaged user 'john' by clicking the add/edit option.

1. Edit the user 'tony' and select the 'sub ssh user' 'tony' as well. This will ensure that the jump server user 'tony' will always login to the remote server as the user 'tony' itself. 

If the sub ssh user is unmanaged, ie if the user 'tony' already exists on remote servers, then you can generate key pair for the user 'tony' and paste the private key below. The public key needs to be entered manually on the remote servers. If you are getting the error Wrong passphrase or corrupted key while adding private keys refer article.
This feature is available from version 7.15.0 only. Refer article to upgrade Ezeelogin to the latest version.

2. SSH as gateway user 'tony' and enter the server centos.server and you will be logged in as the user 'tony' on the remote server centos.server.  Also, you can see that the Sub SSH User listed in the ezinfo command. The user tony would be logged in as system user tony on all servers.


Delete managed or unmanaged SubSSH users?

1. Click on the delete icon of the user.

2. Unmanaged users can simply be deleted by confirming with a click on the yes button.

3. If you want to delete the managed user from remote servers, enable 'Delete user from server.' If you want to delete the home directory of the user from remote servers, enable 'Delete home directory.


How to add a SubSSH user on selected remote servers?

Add Sub SSH User to newly created remote servers.

To create a sub ssh user on a single server or multiple servers at a time, select that remote server from the list and click on Setup Sub SSH Users on selected servers from the right menu bar.

After selecting it will prompt for confirmation. Click on Yes for the sub ssh user creation on the selected remote servers.

To ignore Sub SSH User for a particular remote server enable Ignore Sub SSH User under the Advanced Section of the Server Edit  (Server ->Edit-> Ignore Sub SSH User) so that sub SSH User creation will be ignored for that remote server.

Creation of Subssh user fails

If the Ezeelogin gateway server has more remote servers, it will take more time to create the subssh user in all the servers. Refer below article to increase the execution time of the script in the gateway server.

Increase script execution time in the gateway server

Related Articles:

How to use unmanaged SubSSH users in Ezeelogin?

How to add sub ssh users on remote servers and restrict commands via sudoers file?