Mailing List Archive

further problems Re: scp not found with solaris 8/2.1.0p2
Thanks to Richard June, John Horne and Bosko Radivojevic, who
pointed out that I probably need to set the configure-time option
--with-default-path, so I did this (rather than make symlink
messes, which I'd prefer to avoid) :

1489 ./configure --with-default-path=/bin:/usr/bin:/opt/local/bin --prefix=/opt/local --with-random=/dev/random
1490 make
1491 make install
1492 pkill -TERM sshd
1493 ps -ef | grep sshd
1494 /opt/local/sbin/sshd

teste ssh .. worked fine

tested scp :

{1503} : scp hosts localhost:/tmp/.
root@localhost's password:
sh: scp: not found
lost connection

It's the right scp, and the right sshd :

-rwsr-xr-x 1 root other 745728 May 24 09:32 /opt/local/bin/ssh
-rwxr-xr-x 1 root other 22232 May 24 09:32 /opt/local/bin/scp
-rwxr-xr-x 1 root other 695372 May 24 09:32 /opt/local/sbin/sshd

I compiled them all at 9.30am, so they're the right ones.

Here's some info about the box :

SunOS fwljump02 5.8 Generic sun4m sparc SUNW,SPARCstation-5

Any ideas? I don't want to lodge a bug report if it's just something
dumb I'm missing :)

It's got to be the path somehow, despite having /opt/local/bin in the
config path, it can't find anything in there. I can symlink
to /usr/bin and things work, but that's not what I want to have to
do.

thanks again

Carl
Re: further problems Re: scp not found with solaris 8/2.1.0p2 [ In reply to ]
This is an ongoing problem if you don't compile w/ --prefix=/usr or
--prefix=/ is there anyway to fix this for good?

_PATH_STDPATH is what isn't being defined correctly, if you make these
modifacations to Makefile and to sshd.c after you've run configure,
things should work.

add -DBIN_PREFIX=\"$(bindir)\" to the PATHS line in Makefile like this...

PATHS=-DBIN_PREFIX=\"$(bindir)\" -DETCDIR=\"$(sysconfdir)\"
-DSSH_PROGRAM=\"$(SSH_PROGRAM)\"
-DSSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\"

then add these lines to sshd.c after all the #includes, I put them around
line 40
#ifdef _PATH_STDPATH
#undef _PATH_STDPATH
#endif /* _PATH_STDPATH */
#define _PATH_STDPATH BIN_PREFIX ":/bin:/usr/bin:/sbin:/usr/sbin"

and *DON'T* configure OpenSSH to use Login.
This should work with OpenSSH version 1.2.3, I dunno for sure, mostly this
is theory based on what I've seen. I have no idea if it's even applicable
to OpenSSH 2.x, Good luck.
Re: further problems Re: scp not found with solaris 8/2.1.0p2 [ In reply to ]
Richard June wrote:
>
> This is an ongoing problem if you don't compile w/ --prefix=/usr or
> --prefix=/ is there anyway to fix this for good?
>
> _PATH_STDPATH is what isn't being defined correctly, if you make these
> modifacations to Makefile and to sshd.c after you've run configure,
> things should work.
>
> add -DBIN_PREFIX=\"$(bindir)\" to the PATHS line in Makefile like this...
>
> PATHS=-DBIN_PREFIX=\"$(bindir)\" -DETCDIR=\"$(sysconfdir)\"
> -DSSH_PROGRAM=\"$(SSH_PROGRAM)\"
> -DSSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\"
>
> then add these lines to sshd.c after all the #includes, I put them around
> line 40
> #ifdef _PATH_STDPATH
> #undef _PATH_STDPATH
> #endif /* _PATH_STDPATH */
> #define _PATH_STDPATH BIN_PREFIX ":/bin:/usr/bin:/sbin:/usr/sbin"
>
> and *DON'T* configure OpenSSH to use Login.
> This should work with OpenSSH version 1.2.3, I dunno for sure, mostly this
> is theory based on what I've seen. I have no idea if it's even applicable
> to OpenSSH 2.x, Good luck.

There's still a problem. If you have the files /etc/environment or
$HOME/.ssh/environment and they contain a definition for PATH, this
overrides the compiled-in path.

Perhaps sshd should always append BIN_PREFIX or _PATH_STDPATH to the
PATH variable *after* all the config files have been read. Opinions?
--
Tom Bertelson "Any sufficiently advanced technology
RHI Consulting is indistinguishable from magic."
tbert@abac.com -- Arthur C. Clarke
Re: further problems Re: scp not found with solaris 8/2.1.0p2 [ In reply to ]
But when you use scp do /etc/environment or ${HOME}/.ssh/environment get
read? I wasn't sure, and I haven't had time to play with them enough to
know for sure. I'm of the opinion that BIN_PREFIX should find it's way
into PATH *always* however that's not always possible, e.g. the user
resets PATH in thier initscripts. however that's not OpenSSH's problem.
Re: further problems Re: scp not found with solaris 8/2.1.0p2 [ In reply to ]
Richard June wrote:
>
> But when you use scp do /etc/environment or ${HOME}/.ssh/environment get
> read? I wasn't sure, and I haven't had time to play with them enough to
> know for sure. I'm of the opinion that BIN_PREFIX should find it's way
> into PATH *always* however that's not always possible, e.g. the user
> resets PATH in thier initscripts. however that's not OpenSSH's problem.

Yes, they are read. Scp does the equivalent of "ssh remotehost scp -t
destination". Hard-coding the path in the client doesn't work, since
each host may have it in a different directory.

I like the BIN_PREFIX idea. This is probably safer than _PATH_STDPATH.
--
Tom Bertelson "Any sufficiently advanced technology
RHI Consulting is indistinguishable from magic."
tbert@abac.com -- Arthur C. Clarke
Re: further problems Re: scp not found with solaris 8/2.1.0p2 [ In reply to ]
On Wed, 24 May 2000, Tom Bertelson wrote:

>
>
> Richard June wrote:
> >
> > But when you use scp do /etc/environment or ${HOME}/.ssh/environment get
> > read? I wasn't sure, and I haven't had time to play with them enough to
> > know for sure. I'm of the opinion that BIN_PREFIX should find it's way
> > into PATH *always* however that's not always possible, e.g. the user
> > resets PATH in thier initscripts. however that's not OpenSSH's problem.
>
> Yes, they are read. Scp does the equivalent of "ssh remotehost scp -t
> destination". Hard-coding the path in the client doesn't work, since
> each host may have it in a different directory.
>
> I like the BIN_PREFIX idea. This is probably safer than _PATH_STDPATH.
Yeah, I didn't think about that the first time I asked the question, then
I realized that... which lead the the patch to sshd and Makefile... I
don't know about safer as long as you have BIN_PREFIX
*before* _PATH_STDPATH which is what I do.