Problem trying to sftp/scp PfSense router



  • Hi, all!

    First of all, congratulations on the great work you've been doing on
    pfSense! Here is my problem: I've enabled ssh on my pfSense 1.2.2
    router and am able to run ssh sessions on it normally. However, when
    it comes to using sftp and scp I receive the following errors after
    typing the password in:

    (sftp) Received message too long 170535466
    (scp) protocol error: unexpected <newline>By googling around I learnt one possible reason for such errors is
    pfSense might be echoeing anything (e.g. a menu) when logged in, which
    sftp/scp do not expect. So I tried wrapping the whole contents of
    /etc/rc.initial like this:

    if [ ${TERM} = "menu" ]; then
      <original etc="" rc.initial="">fi

    Now, when I try to use sftp/scp (and TERM is obviously != "menu") they do not complain anymore but the connection is closed right away and no desired effect can be observed. Any ideas how to fix this will be most appreciated. Thanks in advance.

    Cheers,

    Jorge.</original></newline>


  • Rebel Alliance Developer Netgate

    Try to connect with the username "root" instead of "admin", using the same password.



  • Gosh! Thanks a lot for your reply! Just out of sheer curiosity: how is the difference between admin and root implemented?

    Cheers,

    Jorge.


  • Rebel Alliance Developer Netgate

    Glad it helped  :)

    From /etc/passwd:

    root:*:0:0:Charlie &:/root:/bin/sh
    admin:*:0:0:Admin User:/root:/etc/rc.initial
    
    

    Root's shell is /bin/sh and has a .profile that calls /etc/rc.initial, but things like scp can still bypass .profile and execute another command.

    Admin's shell is /etc/rc.initial directly, so it is locked into running that on each login.


Locked