Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to use a different shell when Im scping files to a remote server as compared to when Im logging in. Is there a way to do this? Note that both scp/remote login is done with the same user, so I cant assign scponly as the shell.

The reason I want to do this is because I want my bash_profile to be executed only when I remote login not when Im scping files.

Edit:

Ok so the problem really is my bashrc being executed not my bash_profile as I mentioned before. I source my bashrc from my bash_profile to keep things in one place. I image if I could specify scp to use a shell other than bash then the problem would go away.

share|improve this question

1 Answer 1

Your ~/.bash_profile isn't executed when SCP:ing. I tested this by adding

echo "$(date)" >> "${HOME}/test"

to the end of ~/.bash_profile and looking at tail -f ~/test. On SSH login, a new line was written. On SCP access, a new line was not written.

Have you noticed some unwanted behavior, or did you just assume that it would be a problem?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.