I want to map users (that ssh to server) to emails. In csh you have defined $REMOTEHOST variable that contains PC name from remote host. In bash, no environment variable is defined. Is there any way to get some info about connected user (except from SSH_CLIENT which gives IP and PORT)
Note that I’m using sshd and bash.
No. The only information you can obtain are user, host and port.
You can simply grep the
auth.logfor ssh sessions.I guess you can map usernames to email addresses.
You can simply add a command to
/etc/ssh/sshrcwhich uses the$USERvariable 😉 E.g.