Why am I getting “error stdin: is not a tty, /my/local/directory: no such file or directory”?

I can't figure out why it can't find my directory. I am using the SSH terminal in cPanel to transfer a large directory to my remote server from the local machine I'm on. I ran

scp -r C:/my/local/directory :/my/remote/directory

I've also tried without the -r with just a file and the same error occured. I am typing in the password to the server when it asks but it also asks for a passphrase I do not have access to. I just skip it and it asks me for the password. At the end it says connection to C closed, so I know it's recognizing that. Would it be easier to use FTP? I'm pretty new to linux.

Thanks in advance!

2 Answers

scp interprets : as a separator between host and path. On windows, you can't user absolute path with scp. Rather use relative paths:

cd C:/my/local
scp -r directory/ :/my/remote/directory

You may refer to your home directory / path using the attilde (~) symbol. So if my folder already resides within the home directory of the current user from which I'm trying to copy, I can do something like:

scp -r ~/dir123 :~/.

This would copy dir123 from current loged users home directory (typically in /home/user_id) onto the remote users home directory with the same name & similarly within the root of their home directory.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like