View client username and IP in remote server
How to view the client username and IP address in the production servers?
This feature is available from Ezeelogin version 7.31.0.
1. Login to the remote server added in Ezeelogin and append the below line in the sshd configuration file.
root@remote_server ~]# vim /etc/ssh/sshd_config
AcceptEnv EZ_CLIENT_USER EZ_CLIENT_IP
root@remote_server ~]# systemctl restart sshd
2. Login to the remote server via Ezeelogin and run the below command to view the client username and IP address.
root@remote_server ~]# echo $EZ_CLIENT_USER
root@remote_server ~]# echo $EZ_CLIENT_IP
Example:
root@remote_server:~# echo $EZ_CLIENT_USER
ezadmin
root@remote_server:~# echo $EZ_CLIENT_IP
192.168.1.34
How can the client username and IP address be viewed on all the production servers?
1. Login to the Ezeelogin shell (ezsh) and start the parallel shell (click on * ) and select all servers.
2. Run the below command in the parallel shell.
[group:All servers]# echo "AcceptEnv EZ_CLIENT_USER EZ_CLIENT_IP" >> /etc/ssh/sshd_config ; systemctl restart sshd
3. Exit the parallel shell (click on _ ) and login to the remote server and run the below command to view the client username and IP address.
root@remote_server ~]# echo $EZ_CLIENT_USER
root@remote_server ~]# echo $EZ_CLIENT_IP
Example:
root@remote_server:~# echo $EZ_CLIENT_USER
ezadmin
root@remote_server:~# echo $EZ_CLIENT_IP
192.168.1.34