scp pathing help with f secure and open ssh

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a need to run both f secure ssh and open ssh on the same host.
I also need to be able to point an incoming scp request to the proper
scp binary on the server with both versions.

I have compiled openssh with the default path option, and it is still
going to /usr/bin, even though my default path says to go where the
binary actually is.

Both server and client are AIX machines. It appears the path is being
generated by /etc/environment.

I have the two versions running on different ports and all else is
working ok it seems.

Re: scp pathing help with f secure and open ssh

Quoted text here. Click to load it

Yep, /etc/environment overrides the compile-time defaults (the reasoning
being that run-time configuration by the admin of the server should take
precedence over that of the package builder).

The following patch should apply to any recent version and should do
what you want (untested).

diff -u -p -r1.275 session.c
--- session.c   23 Feb 2004 13:01:27 -0000      1.275
+++ session.c   25 Feb 2004 12:26:13 -0000
@@ -1084,6 +1084,11 @@ do_setup_env(Session *s, const char *she
                read_environment_file(&env, &envsize, "/etc/environment");
+               if (path == NULL || *path == '') {
+                       child_set_env(&env, &envsize, "PATH",
+                           s->pw->pw_uid == 0 ?
+                               SUPERUSER_PATH : _PATH_STDPATH);
+               }
 #ifdef KRB5
        if (s->authctxt->krb5_ticket_file)
                child_set_env(&env, &envsize, "KRB5CCNAME",

Darren Tucker (dtucker at
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Site Timeline