From owner-freebsd-mobile Mon Jul 3 16:11:20 2000 Delivered-To: freebsd-mobile@freebsd.org Received: from mail.networkone.net (mail.networkone.net [209.144.112.75]) by hub.freebsd.org (Postfix) with SMTP id 47DE137C0E3 for ; Mon, 3 Jul 2000 16:11:13 -0700 (PDT) (envelope-from reader@newsguy.com) Received: (qmail 6637 invoked from network); 3 Jul 2000 23:11:02 -0000 Received: from adsl-117-113.ln.networkone.net (HELO reader.ptw.com) (209.144.117.113) by mail.networkone.net with SMTP; 3 Jul 2000 23:11:02 -0000 Received: (from reader@localhost) by reader.ptw.com (8.9.3/8.9.3) id QAA18492; Mon, 3 Jul 2000 16:11:01 -0700 To: freebsd-mobile@FreeBSD.ORG Cc: "Kevin Oberman" Subject: Re: X-display from laptop to desk References: <200007031924.e63JOqn08344@ptavv.es.net> From: Harry Putnam In-Reply-To: "Kevin Oberman"'s message of "Mon, 03 Jul 2000 12:24:52 -0700" Date: 03 Jul 2000 16:10:53 -0700 Message-ID: User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Lines: 71 Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org "Kevin Oberman" writes: > > Date: Sat, 1 Jul 2000 18:13:55 -0700 (PDT) > > From: Jason Fesler > > Sender: owner-freebsd-mobile@FreeBSD.ORG > > > > > If I su to root on the remote, I can no longer run anthing that needs > > > X. For example: > > > > That's because your authentication changed. > > > > What we do at work i "ssh root@localhost", give the root password, > > and a new set of X forwarding is created. At this point you can > > now run X apps as root. > > While this works fine, it moves the IPC from the "local" connect to a > "network" connect which is far less efficient. > > A better solution to this is to redefine the XAUTHORITY variable > to point at your X login .Xauthority file. > > For sh and sons: > XAUTHORITY=/home/jfesler/.Xauthroity > export XAUTHORITY > > For csh and children: > setenv XAUTHORITY ~jfesler/.Xauthority This seems like a good solution.. and works fine. Still one little wrinkle here. First a quick description of what I'm doing: All shells on local and remote are running bash 1.14.7(1) . From an X session on a Redhat Linux box, as user reader, I start an xterm with `ssh-agent xterm' then in that xterm `ssh-add' to add the ssh agent authorization. All further business is from this xterm. Setting the remote to XAUTHORITY=/home/reader/.Xauthority does the magic so far as suing to root. Nice solution... thanks. Logon directly to laptop running FreeBSD as user reader. The laptop has a TERM setting in ~/.bash_profile: TERM=${TERM:-cons25}. I don't recognize that particular syntax but I took it from stock install files. echo $TERM cons25 Now logging in remotely via ssh $ echo $TERM xterm Apparently the calling ssh xterm has brought its own env settings. This causes some unexpected escape characters to appear in certain apps. vim inparticular. Shows `[39m~' when opening a file. The file is displayed so it isn't a huge problem but just annoying. Resetting the remote term to TERM=cons25 makes this disappear and allows normal displays. How can I automatically reset the env variable when sshing in? Does the recieving shell make note of the fact that it is called by ssh? Maybe allowing one to write an: if [ var = ssh ];then TERM=cons25 export TERM fi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message