Subject: Re: newbie questions, uid's, terminals, etc,ssh,sshd
From: [email-masked] (Patrick J. Fay)

12 Jan 1998 18:29:57 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
To: [email-masked]
Cc: [email-masked]

Hello,

On Sun, 11 Jan 1998 [email-masked] wrote:

> Hi all. I just downloaded gnu-win32, ssh-1.2.20, and the
> ssh patches that were posted some time ago. I have ssh running
> under Win95 :) which is pretty cool, but I have a few questions.
I would have used ssh-1.2.21. Which patches did you download?

> 
> How does one deal with UID's when a UNIX program is concerned about
> whether you're root? It seems the UID is always 500, and there's
> no "su". I thought I saw reference to a su program somewhere, but I
> can't find it now. Under Win95 wouldn't it make more sense to always
> be UID 0? I didn't think Win95 understood "users", so everyone is
> effectively root? Ssh has a UID_ROOT compile flag, so I guess for now 
> I'll try setting it to 500.
ssh gets the uid from /etc/passwd. I don't know how win95 does UIDs.
I don't think ssh knows anything about windows UIDs.
I run sshd from the administrator account on win nt.
What are you trying to accomplish with UID 0?

> 
> The terminal acts a bit funny under Win95. When I log in to another
> machine with ssh, it can't clear the screen. Both machines are set
> to TERM=linux. Everything else works fine, but there's always a bit
> of "garbage" on the screen, since the screen erase isn't working.
> 
> Also concerning the terminal, when I first log in with ssh, it seems to
> pause waiting for some keyboard input (which isn't the normal behavior),
> and sometimes starts spitting out "invalid escape" errors until I hit
> cntl-c.
This is because one side (or both) doesn't know about 'TERM=linux' and
sends invalid escape terminal control characters.
ssh doesn't have a term type built into it; it just passes the escape
sequences from one side to the other. There are several ways to 
improve this situation. You can:
 1) buy F-secure ssh from Datafellows.com to get an ssh with vt100 
    built into it.
Note that I use the tcsh for gnuwin32 so the syntax below reflects
that.
 2) build ncurses from ... somewhere. It has a big /etc/termcap and
    terminfo database. I've found that the 'ansi' terminfo entry
    works best if you are ssh'ing from your pc to a unix host and
    trying to do something like vi or pine. It gets the rows and
    columns right and doesn't generate any odd entries. You can
    download just the 'ansi' entry from 
    http://www.acl.lanl.gov/~pfay/teraflop/terminfo_a_ansi.gz.
    then gunzip it, and put it in a dir structure 
    somewhere/terminfo/a/ansi
    setenv TERMINFO somewhere/terminfo
    setterm ansi
      where setterm is
      alias setterm 'set noglob; eval `tset -s -Q -I !*`; unset noglob; echo -n "term type: "; printenv TERM'

    now you should be able to vi and stuff. Don't do resize  on your
    host (unless you don't have scrollbars turned on).
 3) Maybe the simplest solution is to get the version of rxvt that
    doesn't need an xserver installed, start that rxvt, then ssh
    from your pc out. You can get this rxvt xterm from
    http://gnu-win32.paranoia.ru/ Chuck's excellent binaries site.
    If you are trying to ssh into your pc from a unix xterm host that
    has xhost enabled, then you can:
     unix_host> xhost +yourPC_ip_addr
     unix_host> ssh -v -C yourPC_ip_addr  #use -C if your pc is on a modem
      The quality of this session may be good enough for most work.
     you can still:
     your_pc  > rxvt -display yourunix_host:0.0
     
     Chuck's http://gnu-win32.paranoia.ru/ also has gvim.exe client
     (vi using x11) that will let you edit files remotely (without
     popping up a window on your pc and hanging the shell).
 4) Our site has turned off xhost. We have to use ssh and xauth.
    For more on the x11 binaries see 
    ftp://ftp.deninc.com/pub/ports/X11R6.3/README-X11R6.3
    The solution I use is to start the free xserver from www.microimages.com
    and then use rxvt (an xterm for windows) to start an xterm session
    on my pc, then ssh from there out. Then (if you had DISPLAY set 
    before you started your rxvt and TERM=xterm) everything will
    behave properly. 
    If what you want to be able to do is ssh into your pc from a
    unix box then I compile ssh/sshd with the X11 stuff enabled 
    (get the x11 binaries/includes/libs (especially xauth)) from the web,
    and ssh into my pc from a unix-xterm shell. Then you can
    your_pc> setenv DISPLAY your_unix_host:0.0
    your_pc> setenv TERM xterm  #you may need the xterm termcap/terminfo
                                #entry from the rxvt distribution.
    your_pc> gvim.exe -display your_unix_host:0.0

> 
> When I applied the patch to ssh, about half the patches were
> installed correctly, and then it failed with a "hunk assertion failed",
> or some such thing. I applied the last few patches by hand. I saw some
> reference in the mailing list about sources being unpacked in text
> rather than binary mode, or something like that, but I couldn't sort
> out what it meant.
If you were using my patches (or Chuck Bogorad's for that matter), they
were based on ssh1.2.21. 

> 
> Finally, these seems to be something very weird about the way gnu-win32
> treats mixed-case filenames compared to the way linux treats them. If
> I untar'ed ssh from linux, with the windows partition mounted as vfat,
> the file names look like "foo.c" from linux, like "Foo.c" from windows
> explorer, like "FOO.C" from DOS, and like "foo.c" from gnu-win32,
> HOWEVER in gnu-win32 a "ls foo*" does NOT list "foo.c", while a
> "ls foo.c" does list it as "foo.c". Very odd. This broke make until I
> untarred it from gnu-win32 (make would try to make foo.o by looking
> for foo.* and wouldn't find any source file).
> 
> thanks
> b.c.
> -
> For help on using this list (especially unsubscribing), send a message to
> "[email-masked]" with one line of text: "help".
> 

Patrick Fay, Ph.D., Intel Corp.            email:   [email-masked]
Los Alamos National Lab                    wk:         (505) 665-9141
CTI M.S. B296                              fax:        (505) 667-5921
Los Alamos NM 87545    ASCI-RED http://www.acl.lanl.gov/~pfay/teraflop

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".