If the use the following scp command then I get an error:
scp -P 22 [email protected]: /home/username/public_html/* ./
The error I get is:
stdin: is not a tty scp: .: not a regular file
What am I doing wrong?
Thanks for help.
If the use the following scp command then I get an error:
scp -P 22 [email protected]: /home/username/public_html/* ./
The error I get is:
stdin: is not a tty scp: .: not a regular file
What am I doing wrong?
Thanks for help.
If you want to copy everything under public_html, this would be correct way to do it:
scp -r -P 22 [email protected]:/home/username/public_html .
-r recurses through the subdirectories.
You don't need the space after the IP address of the remote machine:
Think of scp the same way you think of cp. cp can't copy directions unless you specify some recursion for it to grab every folder and file within the said folder. If you want to copy a folder, you'd run cp -r folder/ destination/. scp is the same. You'll need to run scp -r user@host:/path/to/folder destination/
As a note, when using the default port for SSH (22) you don't need to specify it in the scp command.