Subject: Re: scp and .profile in 1.5.1_ALPHA
To: Charlie Allom <charlie@rubberduck.com>
From: Jeremy C. Reed <reed@reedmedia.net>
List: current-users
Date: 04/06/2001 12:29:04
On Fri, 6 Apr 2001, Charlie Allom wrote:

> I seem to remember 2 weeks ago, being able to scp a file to a
> host without scp processing my .profile when it logs in.
> 
> the sshd.conf on the receiving machine is set to (the default):
> #UseLogin no

I am looking at session.c and it appears impossible for login to be used.
login is only called if there is no command. But when you do a scp, the
remote sshd runs scp. Also login is launched without any command to
run. And login can't be used to run a command. So I don't think login
is used.

So then it just execs the shell instead. If there is not a command (like
"scp"), then it does exec the shell with argument 0 starting with a dash
so it is considered a login shell -- so it uses .profile.

But if there is a command, then it just runs shell without being a login
shell. And it passes its arguments.

When you do a scp, try the "-v" switch. An example:
 Executing: host rainier, user (unspecified), command scp -v -t J
This is verbose message comes from scp.c's do_cmd() -- it says "This
function executes the given command as the specified user on the given
host."

Does it show the command beeing executed?

> yet with a current 1.5.1_ALPHA, it does seem to process the
> login, resulting in a broken pipe, when it executes fortune.

I am guessing that something else is running your fortune. If you move
your .profile (and check /etc/profile), does it still have this problem?
Or maybe try adding something to .profile that creates a temp file to see
if it was really used.

On Sat, 7 Apr 2001, Charlie Allom wrote:
> The problem started with a make build of 1.5.1_ALPHA, so (and
> this will answer one of the things I've often wondered about)
> where can I find a list of changes made to netbsd-1-5 ?

Maybe this can help: Try the http://cvsweb.netbsd.org/ interface. Go to
basesrc -> crypto -> dist --> ssh. Then at the bottom select the
"netbsd-1-5" tag (Show only files). Looks like a lot has changed.

But I am confused between OpenSSH and {Net,O,NetBSD}SSH -- are the sources
kept in the same place? Same file names? Or can I have both sources
installed and just one Makefile config chooses which is built and
installed?

   Jeremy C. Reed
   http://www.reedmedia.net/