Re: scp sourcing .tcshrc???

From: Nico Kadel-Garcia (
Date: 11/15/03

  • Next message: Nico Kadel-Garcia: "Re: OT: Pgp trusted keys for OpenSSH download, help with usage please"
    Date: Sat, 15 Nov 2003 10:12:42 -0500

    "Neil W Rickert" <> wrote in message
    > (jonathan) writes:
    > >I just noticed whilst copying items that scp sources my cshrc file, goes
    > >the tcshrc file as well - just to copy some files.
    > >my question is:
    > >1) why?
    > It is part of unix security, that commands are executed using your
    > login shell.
    > Your shell sources these files on startup.

    This is because the "scp" function rely lives on top of "ssh", which uses a
    shell. Also, the .tcshrc or .profile or other .files depending on your shell
    may set alternative $HOME or umask settings on an individual user basis.
    This would affect the behavior of both ssh and scp.

    > >2) how do I stop this from happening?
    > Maybe change to a different shell. Or delete the files that you
    > don't want sourced.

    Or check in your .tcshrc if you're in an interactive session (look for a
    $TERM) before executing whatever bit of fun is interfering with your scp
    sessions. I've seen way, way, way too many badly written .cshrc files that
    interfere with ssh and scp and cvs or rsync over ssh because they spewed
    "announcements" for no reason on non-interactive connections.

  • Next message: Nico Kadel-Garcia: "Re: OT: Pgp trusted keys for OpenSSH download, help with usage please"

    Relevant Pages

    • vulnerabilities in scponly
      ... without allowing shell access. ... scponly makes no effort to verify the path to the scp or sftp-server ... arbitrary commands by simply uploading a file. ... However, if this is *NOT* the case, the user could execute arbitrary ...
    • Re: ssh works / scp fails - thanks to login script output !
      ... I got ssh to work, but scp kept failing. ... If rsync is an option I am okay with that as well, ... You can verify if your shell is doing this by executing: ...
    • Re: scp syntax and denied permission
      ... >> this is sort of a newby question but in some regards it might be not. ... > The tilde is interpreted by the shell and ... on the destination system, so if home dirs are different on the 2 boxes, you'll ... >> When I try to copy the next higher directory the scp starts but once ...
    • Re: scp does not copy, no error msg, ssh works
      ... > scp gets confused if there is any output from the target. ... sourced on every interactive invocation of the shell. ... only when it's a login shell. ...
    • Re: Difference between SCP and SFTP ?
      ... >>But It's seems that SCP need a user Shell, ... > sftp is just FTP over SSH. ... It's interface is similar to FTP, ...