From owner-freebsd-bugs Tue Sep 4 5:28:40 2001 Delivered-To: freebsd-bugs@freebsd.org Received: from ringworld.nanolink.com (discworld.nanolink.com [217.75.135.248]) by hub.freebsd.org (Postfix) with SMTP id 26AFD37B407 for ; Tue, 4 Sep 2001 05:26:02 -0700 (PDT) Received: (qmail 77900 invoked by uid 1000); 4 Sep 2001 12:16:20 -0000 Date: Tue, 4 Sep 2001 15:16:20 +0300 From: Peter Pentchev To: "Alexey N. Nazarov" Cc: freebsd-bugs@FreeBSD.ORG Subject: Re: question! Message-ID: <20010904151620.K61594@ringworld.oblivion.bg> Mail-Followup-To: "Alexey N. Nazarov" , freebsd-bugs@FreeBSD.ORG References: <20010904134818.I61594@ringworld.oblivion.bg> <20010904143413.S48123-100000@frux.iptelecom.net.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010904143413.S48123-100000@frux.iptelecom.net.ua>; from blaze@iptcom.net on Tue, Sep 04, 2001 at 02:55:56PM +0300 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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