# scp problem [SOLVED]

## gentoo4erik

Hoi, hoi,

I got a problem while trying to transfer my files from my local machine to a remote machine (located somewhere on the net). When I use WinSCP under Windows everything works, but not with Gentoo.

I use the command

```
scp -vvv file.txt name@host:~

```

I can login without problem. But after that the process stalls. Here is the verbose output:

```
debug2: input_userauth_info_req: num_prompts 1

Password:

debug3: packet_send2: adding 32 (len 22 padlen 10 extra_pad 64)

debug2: input_userauth_info_req

debug2: input_userauth_info_req: num_prompts 0

debug3: packet_send2: adding 48 (len 10 padlen 6 extra_pad 64)

debug1: Authentication succeeded (keyboard-interactive).

debug2: fd 4 setting O_NONBLOCK

debug2: fd 5 setting O_NONBLOCK

debug1: channel 0: new [client-session]

debug3: ssh_session2_open: channel_new: 0

debug2: channel 0: send open

debug1: Entering interactive session.

debug2: callback start

debug2: client_session2_setup: id 0

debug1: Sending command: scp -v -t ~

debug2: channel 0: request exec confirm 0

debug2: callback done

debug2: channel 0: open confirm rwindow 0 rmax 32768

debug2: channel 0: rcvd adjust 131072

```

After that, nothing happens and after a couple of minutes I terminate the command. The file is not copied to the remote host. Does anyone know what is happening here ? Does anybody have a solution ?

Groetjes,

ErikLast edited by gentoo4erik on Sat Jan 21, 2006 9:32 pm; edited 1 time in total

----------

## JRV

Just for info,

I tried scp -vvv (of course, it's working here) and I get exactly the same output, but mine goes on like this:

 *Quote:*   

> 
> 
> [exactly the same output you had]
> 
> ...
> ...

 

So there aren't any errors in your output, it just stops for some weird reason...

JRV

----------

## splooge

This might seem rather dumb but ... try removing the trailing ~ ... it will go to your homedir if you just type user@host:

On my BSD box at work when I did it with a trailing ~ I ended up with a file named '~' in my homedir.  I could see this being a potential problem.  (rm -r ~ ... what might that do?  delete the file?  or delete the homedir itself? depending on where I typed the command?)

Stupid, I know, but ... whatever.  Just a theory.

----------

## gentoo4erik

 *Quote:*   

> This might seem rather dumb but ... try removing the trailing ~ ... it will go to your homedir if you just type user@host: 

 

I tried it without the trailing ~.This doesn't help. Still no file transferred. The process stalls again.

I do not know if this matters: The remote host is not linux based, but uses FreeBSD 4.10-RELEASE-p2 i386. Is it possbile that Linux does not "speak" well with FreeBSD for some reason?

Groetjes,

Erik

----------

## gentoo4erik

Ok solved.

The problem was that on the remote side the standard shell is the tc-shell. So I had a .tcshrc that started /bin/bash which started .bashrc

And there it went wrong. Scp (and sftp) didn't like that.

When I removed .tcshrc on the remote host (so /bin/bash was not started) scp worked fine !!!

I even found some information about that in the openssh faq:

 *Quote:*   

> 2.9 - sftp/scp fails at connection, but ssh is OK.
> 
> sftp and/or scp may fail at connection time if you have shell initialization (.profile, .bashrc, .cshrc, etc) which produces output for non-interactive sessions.
> 
> 

 

I do not quite understand the "output". There is no output when starting bash (or it must be that bash gives another prompt than tc).

But anyhow: it is working.

Thanks JVR and sploogle for helping me

Groetjes,

Erik

----------

