VectorLinux
October 20, 2014, 03:11:57 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: scp problem solved  (Read 1185 times)
robstr12
Member
*
Posts: 4


« 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 2.6.22.14

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: http://www.openssh.com/faq.html#2.9, I see that:

Quote
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/vasm.sh 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:
nocona:/~
rlw:$ diff /etc/profile.d/vasm.sh /etc/profile.d/vasm.sh.orig
34a35,74
> 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.




Regards,

Robert
Logged
saulgoode
Vectorite
***
Posts: 340



« 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.
Logged

A complex system that works is invariably found to have evolved from a simple system that works.
robstr12
Member
*
Posts: 4


« 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".  Cheesy

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!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!