In the system there are 2 network ents configured (both can be used for remote access).
The will be executed script which will swap a desired IP address with a new one - I need to avoid terminal loss in case user logged to the system via the address which will be swapped by a new one.
has anyone idea how to perform such test?
I openssh session I can obtain the address with command:
$ env|grep ^SSH_CONNECTION|awk '{print $(NF-1)}'
10.122.22.16
But when I switch (su) root account (I need to switch with "su -" gettign root's env) the information is lost:
# env|grep ^SSH_CONNECTION|awk '{print $(NF-1)}'
#
Maybe someone knows some more reliable method for getting the address?
The will be executed script which will swap a desired IP address with a new one - I need to avoid terminal loss in case user logged to the system via the address which will be swapped by a new one.
has anyone idea how to perform such test?
I openssh session I can obtain the address with command:
$ env|grep ^SSH_CONNECTION|awk '{print $(NF-1)}'
10.122.22.16
But when I switch (su) root account (I need to switch with "su -" gettign root's env) the information is lost:
# env|grep ^SSH_CONNECTION|awk '{print $(NF-1)}'
#
Maybe someone knows some more reliable method for getting the address?