[Solved] ssh works but scp does not

2011-08-29 168 words 1 min read

Structure of an SSH binary packet
Image via Wikipedia

For quite sometime now, I was having this issue, that for the home system, I was able to connect to is using ssh but it never worked. Fnally after quite some debugging finally I found that the issue was with thebashrc. So, everytime I had to do a scp I would have to move/rename bashrc and do the reverse action after the scp was done.

Finally today I fixed it and the solution was very simple. I put the offending code or rather complete bashrc in the loop as mentioned below:

 

  <td>
    <div class="text codecolorer">
      if [[ $SSH_CLIENT = "" ]<br /> <br /> then<br /> <br /> <bashrc code here><br /> <br /> fi
    </div>
  </td>
</tr>
1
2
3
4
5
6
7

By doing this the bashrc is never executed when a ssh session is initiated (which is what happens for scp also). 🙂

Enhanced by Zemanta

author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it