avatar
equivilent $REMOTEHOST in ksh# Unix - 噫吁兮,危乎高哉
h*h
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
avatar
m*e
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

avatar
h*h
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
avatar
c*t
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?

avatar
h*h
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?
avatar
h*h
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?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。