I have been searching for a while and I can't find the definition of a regular file. My path is permanent (I start at /) and I am connecting to

scp root@IP: /path/to/picture.jpg

Results in an inquiry for a password and then...

scp: .: not a regular file

7 Answers 7


When copying a directory, you should use the -r option:

scp -r root@IP:/path/to/file /path/to/filedestination

A regular file is a file that isn't a directory or more exotic kinds of “special” files such as named pipes, devices, sockets, doors, etc. Symbolic links are not regular files either, but they behave like their target when it an application is accessing the content of the file.

You passed root@IP: as the source of the copy and /path/to/picture.jpg as the destination. The source is the home directory of the user root on the machine IP. This is useful as a destination, but not as a source. What you typed required to copy a directory onto a file; scp cannot copy a directory unless you ask for a recursive copy with the -r option (and it would refuse to overwrite an existing file with a directory even with -r, but it would quietly overwrite a regular file if the source was a regular file).

If /path/to/picture.jpg is the path on the remote machine of the file you want to copy, you need to stick the file name to the host specification. It's the colon : that separates the host name from the remote path. You'll need to specify a destination as well.

scp root@IP:/path/to/picture.jpg /some/destination

If you want to copy the local file /path/to/picture.jpg to the remote host, you need to swap the arguments. Unix copy commands put the source(s) first and the destination last.

scp /path/to/picture.jpg root@IP:

If you want to copy the remote file /path/to/picture.jpg to the same location locally, you need to repeat the path. You can have your shell does the work of repeating for you (less typing, less readability).

scp root@IP:/path/to/picture.jpg /path/to/picture.jpg
scp {root@IP:,}/path/to/picture.jpg
  • 3
    make sure no spaces exist between the hostname and file
    – chris
    Feb 26, 2015 at 0:30
  • I feel so incredibly silly after reading this. source, destination! Duh! Feb 26, 2018 at 1:44

You are getting that error because you are trying to copy a folder and not file and hence you should copy your files recursively by using -r option

Use below command when copying files from remote machine to local machine

scp -r root@RemoteIP:/path/to/file /path/to/filedestination


When copying files from local machine to remote machine

scp -r /path/to/file root@RemoteIP:/path/to/filedestination

syntax issue - remove the white space between




  • But, then you don't have a target for scp anymore.
    – Bernhard
    Oct 23, 2012 at 6:07
  • yup. i pressed enter too quickly and lack the rep to fix it. surprised i can even comment here. cheers.
    – lurker
    Oct 23, 2012 at 7:53
  • 2
    I think you can always comment to your own contributions, and I thought you could also always edit them?
    – Bernhard
    Oct 23, 2012 at 8:00
  • I don't thik that can cause this error not a regular file
    – HISI
    Mar 7, 2018 at 13:20
  • @hisi use -r as scp argument. May 1, 2018 at 5:02

scp root@IP:/path/to/file /path/to/filedestination

Above command copies a file from remote server to your computer. If you type only scp root@IP: it will try to copy the home directory of root (scp users home .).

So you need to provide the exact path to the file

  • This worked. Thanks a bunch, man. Keep it up!
    – JeffM
    Oct 23, 2012 at 5:00
scp root@IP:/path/to/*.jpg  /path/to/filedestination/

This will work(at least on my Mac)


This is late answer, but I hope this will help someone who got my issue.

I also got same issue when try to upload a zip file to a remote server.

My problem was, I missed : , what I had used is : scp myfile.zip remoteuser@IP/destination/folder

It should be scp myfile.zip remoteuser@IP:/destination/folder

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .