Please support VectorLinux!

Author Topic: scp problem solved  (Read 1310 times)


  • Member
  • *
  • Posts: 4
scp problem solved
« on: December 29, 2007, 10:04:21 pm »
Hello, I just installed your distro, and really like it!  Thank you!

The version is:
5.9 Standard GOLD built on Dec-16-07 on Linux

Now, I was having issues using 'scp' to copy files TO the Vector Linux box.  I could scp files FROM the Vector Linux box just fine.

It seems like I have found the solution, as well.  In the OpenSSH faq, located here:, I see that:

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. This output confuses the sftp/scp client. You can verify if your shell is doing this by executing:

    ssh yourhost /usr/bin/true

If the above command produces any output, then you need to modify your shell initialization.

So, I editted my /etc/profile.d/ file.  I simply took out everything that produced output that I could find.  I ended up with this:

(vasm.orig is the file that shipped with the distro, vasm is the file AFTER the edits):

Code: [Select]
rlw:$ diff /etc/profile.d/ /etc/profile.d/
> if [ "$UID" = 0 ]; then
>    echoc "You are working as root" red
>    export CFLAGS="-O2 -march=i586 -mcpu=i686"
>    export CXXFLAGS="-O2 -march=i586 -mcpu=i686"
>    export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin"
>    if [ -z "$USER" ] || [ "$USER" != "root" ]; then
>       UHOME=`egrep "^$USER:" /etc/passwd | cut -f6 -d:`
>       if [ -f $UHOME/.Xauthority ]; then
>        # echo "Enabling X-Window $UHOME/.Xauthority"
>        cp $UHOME/.Xauthority /root
>       fi
>    fi
>    echoc "Frequently used programs:" cyan
>    echo "Configuration  : vasm"
>    echo "Package manager: slapt-get, pkg"
>    echo "Network tools  : ifconfig, host, ping, nmap, iptables"
> else
>    echoc "You are working as $USER" green
>    echoc "Frequently used programs:" cyan
>    echo "Configuration  : vasm"
>    ## If the user has has a unique group (Redhat system)
>    ## set the umask 002 to allows owner and group writable.
>    if grep -qe "^$USER:" /etc/group &>/dev/null; then
>       umask=002
>    fi
> fi
> echo "File manager   : mc (press F2 for useful menu)"
> echo "Editor         : mcedit, nano, vi"
> echo "Multimedia     : alsamixer, play"
> if [ -z "`skill -n X`" ]; then
> which startx &>/dev/null        && echo "Default X      : startx"
> #which starticewm &>/dev/null    && echo "IceWM          : starticewm, starticewm-desk, starticewm-sound"
> #which startfluxbox &>/dev/null  && echo "Fluxbox        : startfluxbox, startfluxbox-desk"
> which startxfce4 &>/dev/null    && echo "XFCE4          : startxfce4"
> #which startkde &>/dev/null      && echo "KDE            : startkde"
> fi

In any event, scp now works fine for me.

If there are any other users who are as new to this as I am, and are having trouble with scp -ing files TO their Vector Linux box, perhaps this will also help them.




  • Vectorite
  • ***
  • Posts: 340
Re: scp problem solved
« Reply #1 on: December 29, 2007, 10:28:33 pm »
I encountered this problem VL 5.8 and proposed a solution in this post which won't modify the output for interactive (non-ssh) logins. I thought that this was addressed in recent versions.
A complex system that works is invariably found to have evolved from a simple system that works.


  • Member
  • *
  • Posts: 4
Re: scp problem solved
« Reply #2 on: December 30, 2007, 02:11:32 pm »
Ah, yes.  Thank you for your reply, saulgoode.  I like your fix better, its a little less "heavy handed".  :D

Evidently, this problem persists with 5.9, for what its worth.  A minor problem to fix, though.  Hehe, I could not do without scp access to my Vector box, LOL!