Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Sep 2001 15:16:20 +0300
From:      Peter Pentchev <roam@ringlet.net>
To:        "Alexey N. Nazarov" <blaze@iptcom.net>
Cc:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: question!
Message-ID:  <20010904151620.K61594@ringworld.oblivion.bg>
In-Reply-To: <20010904143413.S48123-100000@frux.iptelecom.net.ua>; from blaze@iptcom.net on Tue, Sep 04, 2001 at 02:55:56PM %2B0300
References:  <20010904134818.I61594@ringworld.oblivion.bg> <20010904143413.S48123-100000@frux.iptelecom.net.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 04, 2001 at 02:55:56PM +0300, Alexey N. Nazarov wrote:
> 
> Good daytime.
> 
> Thanks Peter, i have in my ~/.tcshrc only one program - UPTIME!
> All work now!
> 
> Question: This is a BUG or documented BUG aka Ficha ? ;-)

It's not really a bug, it's what the common rules of logic
and scp/ssh/login interaction would dictate :)

What happens is the following:

- You invoke 'scp $FILENAME $USER@$HOST'
- scp invokes 'ssh -l $USER $HOST some-server-side-scp-helper'
- ssh logs in as $USER@$HOST
- the SSH server at $HOST starts up $USER's shell, passing it
  'some-server-side-scp-helper' as a command to execute
- $USER's shell - in this case, tcsh - does everything it would normally
  do when invoked in non-interactive mode.  What tcsh does in
  non-interactive mode is, it sources /etc/csh.cshrc and ~/.tcshrc,
  as described in the tcsh(1) manual page.
- tcsh executes any command it finds in ~/.tcshrc.

In .tcshrc, you should only place essential commands/settings
which you want to be executed any time any kind of utility decides
to do something in your name - as your user.  Everything that
you want to start at an interactive login should be placed in
/etc/csh.login and ~/.login, as described in the tcsh(1) manual page.
~/.tcshrc should only contain things like PATH or such, which you
want to make available for the use of non-interactive utilities,
such as 'ssh $USER@$HOST run some command'.

So, if you want to see the machine's uptime every time you log in,
place the 'uptime' command in ~/.login, not in ~/.tcshrc.

G'luck,
Peter

-- 
I've heard that this sentence is a rumor.

> PP>On Tue, Sep 04, 2001 at 01:41:45PM +0300, Alexey N. Nazarov wrote:
> PP>>
> PP>> Good daytime.
> PP>>
> PP>> Problem: I want do Secure Copy from Host To Host with scp
> PP>>
> PP>> $USER is not root
> PP>>
> PP>> scp $FILENAME $USER@$HOST:
> PP>> then type my password for $HOST and see sessage
> PP>> 'ttyname: Inappropriate ioctl for device'
> PP>>
> PP>>
> PP>> 10:50 [blaze@frux:p6][~] uname -a
> PP>> FreeBSD frux.iptelecom.net.ua 4.4-RC FreeBSD 4.4-RC #1: Thu Aug 30
> PP>> 21:38:27 EEST 2001
> PP>> root@frux.iptelecom.net.ua:/usr/src/sys/compile/FRUX  i386
> PP>>
> PP>> How i can fix it?
> PP>
> PP>Do you have a ~/.profile, ~/.cshrc, ~/.bash_profile, ~/.bashrc or
> PP>some such shell startup file for the $USER account on $HOST,
> PP>that might call some external program which would want to call
> PP>ttyname?
> PP>
> PP>I had similar problems when I had put a 'fortune' call in .bashrc,
> PP>which got invoked for each and every login, including non-interactive
> PP>logins used for scp; the fortune output really mangled the scp protocol..

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010904151620.K61594>