h**h 发帖数: 132 | 1 there is $REMOTEHOST in tcsh, but how to get this equivilent
variable in ksh?
the purpose is when telnet to the server, .profile will
automatically set the DISPLAY without manually input.
thanks |
m*****e 发帖数: 4193 | 2 use ssh
【在 h**h 的大作中提到】 : there is $REMOTEHOST in tcsh, but how to get this equivilent : variable in ksh? : the purpose is when telnet to the server, .profile will : automatically set the DISPLAY without manually input. : thanks
|
h**h 发帖数: 132 | 3 that's definitely an alternative to tunnel xwindow traffic.
But since hundreds of users are used to telnet, and it's
expensive
to spend dollars for hundreds of licenses of ssh client
still looking for cheap solution.
there should be a simple script to identify whether it is
console login or not, if not, then decide where the user is
from, then define DISPLAY variable.
Any ideas?
【在 m*****e 的大作中提到】 : use ssh
|
c*****t 发帖数: 1879 | 4 There is a way, but not very good.
1. get current tty
2. finger -l username | grep tty | cut fromremotesite
3. check if it is the console, setenv
p.s. last is not as good as finger.
【在 h**h 的大作中提到】 : that's definitely an alternative to tunnel xwindow traffic. : But since hundreds of users are used to telnet, and it's : expensive : to spend dollars for hundreds of licenses of ssh client : still looking for cheap solution. : there should be a simple script to identify whether it is : console login or not, if not, then decide where the user is : from, then define DISPLAY variable. : Any ideas?
|
h**h 发帖数: 132 | 5 This doesn't work either, since most unix servers disable
finger server
well, the worst case is to write a shell script
to
1> who -m
user pts/9 Oct 20 17:35 (10.10.10.10)
2> parse info between ($REMOTEHOST)
3> See if it is from console or not
4> export DISPLAY=$REMOTEHOST:0.0
put that in .profile or .login? |
h**h 发帖数: 132 | 6 export REMOTEHOST="`who am i | sed -n 's/.*(\(.*\))/\1/p'`"
【在 h**h 的大作中提到】 : This doesn't work either, since most unix servers disable : finger server : well, the worst case is to write a shell script : to : 1> who -m : user pts/9 Oct 20 17:35 (10.10.10.10) : 2> parse info between ($REMOTEHOST) : 3> See if it is from console or not : 4> export DISPLAY=$REMOTEHOST:0.0 : put that in .profile or .login?
|