sshcshrsh

How to determine current remote connection type? (rsh or ssh)


I want to know if there is some methods to find out the current connection type to remote server (rsh or ssh?). Environment is Solaris 9, SuSE linux, csh.


Solution

  • You can use echo $SSH_CONNECTION;. SSH will set this environment variable on the remote server. It contains the client IP, client port, server IP, and server port. It should only be set for SSH connections.