[vox-tech] Providing access to SSH on Kiosk?

Ken Herron vox-tech@lists.lugod.org
Mon, 12 Jan 2004 15:06:50 -0800


--On Monday, January 12, 2004 14:42:48 -0800 Bill Kendrick 
<nbs@sonic.net> wrote:

>> user='foo'
>> host='bar `xterm`'
>> xterm -e ssh $user@$host
>>
>> Will pop up an xterm running ssh, and once you log in an xterm running
>> bash   :-)
>
> That's a good one to be afraid of.  I'm sure there's some shell magic I
> can do to get around this issue.  Probably some regexp some Unix guru
> came up with back in the 70s? ;^)

Your best bet might be to avoid sh altogether and use perl, c, or 
something like that:

	#!/usr/bin/perl -w
	print "Host: ";
	my $host = <STDIN>; chomp $host;
	print "Username: ";
	my $user = <STDIN>; chomp $user;
	exec('/usr/bin/ssh', '-l', $user, $host);
	exit 1;

Store this in a file, mark it executable, and run it as "xterm -e 
/path/to/script". The user can type any old garbage they like for the 
username or hostname. Ssh will just see it as a funny-looking username or 
hostname.

-- 
"Grand Funk Railroad paved the way for Jefferson Airplane, which cleared
the way for Jefferson Starship. The stage was now set for the Alan Parsons
Project, which I believe was some sort of hovercraft." - Homer Simpson

Kenneth Herron        Kherron@newsguy.com       916-366-7338