Not a regular file error scp

not a regular file error scp

Try omitting the trailing dot like this: function ec2-scp() { scp -i /path/to/pem/file.pem $1 [email protected]: }. 3. Try: scp [email protected]:~/pictures/file. · 1 · Tilda will be your best friend in this case:). · Log in with ssh (ssh [email protected]) and give command: file /. superuser.com › questions › scp-error-not-a-regular-file.

Related Videos

scp error: not a regular file

Not a regular file error scp - share

Error using SCP: “not a regular file”

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 as the source of the copy and as the destination. The source is the home directory of the user on the machine . This is useful as a destination, but not as a source. What you typed required to copy a directory onto a file; cannot copy a directory unless you ask for a recursive copy with the option (and it would refuse to overwrite an existing file with a directory even with , but it would quietly overwrite a regular file if the source was a regular file).

If 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.

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

If you want to copy the remote file 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).

SFTP get not a regular file – Easy fix for this file transfer error

Checking out why the SFTP ‘get’ is throwing the error not a regular file?

The answer is quite simple, add the SFTP option flag to transfer non-regular files.

At Bobcares, we get many requests to fix SFTP errors, as a part of our Server Management Services.

Today, let’s have a look into this SFTP error. We will also see how our Support Engineers fix this.

 

A snapshot on SFTP get and regular file

Before getting into the error, let’s familiarize what is SFTP.

SFTP aka Secure File Transfer Protocol ensures secure data transfer over SSH. Hence this is otherwise known as SSH File Transfer Protocol.

SFTP use get command to transfer remote files to a local system. For transferring regular files, we use a simple get command. But in case of non-regular files, we need to add option flags to the command.

But what are regular and non-regular files in Linux?

Files like text files, images, binary files, etc are regular files. All others are non-regular files. That is directories, symbolic links, etc. So, improper commands can end up in SFTP get errors. Let’s check out the below instance.

 

How we fix the error SFTP get ‘not a regular file’?

Recently, one of our customers approached us with an SFTP error. Our Support Engineers checked the error. The customer tried the get operation using the command,

And he got the error message,

The reason was clear, the command usage missed an important flag. That is, for transferring non-regular files or directories, we need to add -r flag. Where -r indicates recursive action.

Hence our Support Engineers corrected the code to,

And this fixed the error.

 

Alternatives to SFTP

SCP allows secure copying of files and directories between remote hosts. It relays on SSH to transfer data. The command to transfer file is,

Similarly, for remote transfer of file, we use rsync. Rsync allows both remote and local file transfers securely.

 

[Still having trouble in transferring files remotely? – We’ll help you.]

 

Conclusion

In short, SFTP get not a regular file is an error message which indicates an incomplete command usage. So, either transfer the file recursively or use alternatives like SCP or rsync. Today, we saw how our Support Engineers help customer transfer files remotely.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

Error using SCP: "not a regular file"

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 as the source of the copy and as the destination. The source is the home directory of the user on the machine . This is useful as a destination, but not as a source. What you typed required to copy a directory onto a file; cannot copy a directory unless you ask for a recursive copy with the option (and it would refuse to overwrite an existing file with a directory even with , but it would quietly overwrite a regular file if the source was a regular file).

If 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.

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

If you want to copy the remote file 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 gives "not a regular file"

It is possible that you are working with a directory/folder.

If this is the case, here is what you want to do:

  1. First, compress the folder. By running the command:

    zip -r name_of_folder.zip name_of_folder

  2. Then use the scp command normally to copy the file to your destination:

    scp path/to/name_of_folder.zip server:localhost:/path/to/name_of_folder.zip

  3. Enter your password if it prompts you for one.

  4. Unzip the name_of_folder.zip with this command:

    unzip name_of_folder.zip

That is it, you now have your folder in the destination system. By the way, this is for zip compression.

NOTE: If you are on Mac OS and you don't want to see resource files such as _MACOSX, you may run:

Meaning the above command should be used instead of that in step 1 above.

answered Sep 14, 2019 at 3:01

user avatar
francfranc

72977 silver badges1515 bronze badges

WinSCP 5.9.4 release - error transfering file - images Not a regular file

martin◆
Site Admin
martin avatar
Joined:
Posts:
37,665
Location:
Prague, Czechia
Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

not a regular file error scp

The SCP command is used to copy files to and from the remote system to the local system safely through the SSH protocol. Using SSH means that it enjoys the same level of data encryption as SSH, so it is considered a safe way to transfer files across two remote hosts.
Basic grammar
The following provides the basic syntax of the SCP command:

$ scp [option] /path/to/source/file [email protected]:/path/to/destination/directory
/Path / to / source / file – this is the source file that you intend to copy to the remote host.

[email protected] -IP: – this is the user name and IP address of the remote system. Note that the IP address is followed by a colon.

/Path / to / destination / directory – this is the destination directory on the remote system to which the file will be copied.

Here are some common options for the SCP command:

-C – this compresses files or directories not a regular file error scp replication.
-P – use this option to specify the SSH port if the default SSH port is not 22.
-R – this option recursively copies the directory and its contents.
-P – the access and modification time of the reserved file.
Copy files to a remote Linux server
In the following example, not a regular file error scp, I will log tar. GZ copy to the / root directory of the remote host. The p5ld2 cpu ucode loading error IP is 192.168.43.137 and the user name is root.

[[email protected] ~]# scp logs.tar.gz [email protected]:/root
SCP command usage SCP command usage
If you want to copy directories, use the – R option, as shown below. Here, we copy the / root / syslog directory to the / root directory of the remote node.

[[email protected] ~]# scp -r syslog [email protected]:/root
SCP command usage SCP command usage
If you do not add the – R option to copy the directory, the following error will be prompted.

[[email protected] ~]# scp syslog [email protected]:/root
[email protected]’s password:
syslog: not a regular file
SCP command usage SCP command usage

Copy files from remote system to local system
You can copy files from a remote node to the local system as follows:

$ scp [option] [email protected]:/path/to/source/file/path/to/local/directory
In the following example, we copy the file / root / passwd from the remote system to the local system:

[[email protected] ~]# scp [email protected]:/root/passwd /root/
SCP command usage SCP command usage
Similarly, you can use the – R flag to copy the directory from the remote host to the local system, as shown in the figure.

[[email protected] ~]# scp -r [email protected]:/root/scripts /root/
SCP command usage SCP command usage
For more options on using the SCP command, you can check the manual. The command is: man SCP
SCP command usage SCP command usage

summary
The Linux SCP command is a convenient and secure way to transfer files between two remote nodes without worrying about attackers snooping on your data.

Error using SCP: “not a regular file”

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, not a regular file error scp. 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 as the source of the copy and as the destination. The source is the home directory of the user on the machine. This is useful as a destination, but not as a source. What you typed required to copy a directory onto a file; cannot copy a directory unless you ask for a recursive copy with the option (and it would refuse to overwrite an existing file with a directory even withbut it would quietly overwrite a regular file if the source was a regular file).

If is the path on the remote machine of the file you want to not a regular file error scp, 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.

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

If you want to copy the remote file 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).

WinSCP 5.9.4 release - error transfering file - images Not a regular file

martin◆
Site Admin
martin <a href=error reference made to unresolved external Joined:
not a regular file error scp Posts:
37,665
Location:
Prague, Czechia
Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, not a regular file error scp, account names or file names (unless they are relevant to the baseboard management controller set test error sr6850hw4m. If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

scp gives "not a regular file"

It is possible that you are working with a directory/folder.

If this is the case, here is what you want to do:

  1. First, compress the folder. By running the command:

    zip -r name_of_folder.zip name_of_folder

  2. Then use the scp command normally to copy the file to your destination:

    scp path/to/name_of_folder.zip server:localhost:/path/to/name_of_folder.zip

  3. Enter your password if it prompts you for one.

  4. Unzip the name_of_folder.zip with this command:

    unzip name_of_folder.zip

That is it, you now have your folder in the destination system. By the way, this is for zip compression.

NOTE: If you are on Mac OS and you don't want to see resource files such as _MACOSX, you may run:

Meaning the above command should be used instead of that in step 1 above.

answered Sep 14, 2019 at 3:01

user avatar
francfranc

72977 silver badges1515 bronze badges

No Such File Or Directory In SCP: How To Fix The Error [MiniTool Tips]

Are you error insufficient memory bios with the error - No such file or directory? Probably you will say yes, right? But do you know what does it mean in SCP? If not, you should read the following content carefully since it introduces the causes of No such file or directory error in SCP and the corresponding measures you should take to solve the problem yourself.

You may see the No such file or directory error now and then in different problems. Here in this article, I will mainly talk about the No such file or directory error in Secure Copy Protocol. What triggers this SCP error? How to fix it in different ways without others’ help? All these questions will be answered below.

No such file or directory

Please pay much attention to MiniTool Solution since it is professional in storage management and problem solving.

No Such File or Directory in SCP

First of all, I’d like to explain what SCP is. As the acronym of Secure Copy Protocol, the SCP refers to a security file transfer protocol between a local host and a remote host or among different remote hosts. SCP is developed on the basis of Secure Shell (SSH) protocol and used to help people sql logic error ftd files among different devices. The SCP has many in common with FTP (File Transfer Protocol) except that the former adds security and authentication.

However, a lot of people reported recently that come across SCP no such file or directory error when they are trying to copy files with the program. Noticing this, I decide to list some of the common reasons that cause the SCP error and the corresponding solutions to fix it.

Create Script To Copy Files From One Folder To Another On Win10.

Causes of No Such File or Directory Error

There are mainly 4 reasons that should be responsible for the Secure Copy Protocol - no such file or directory.

  • Port number is not specified: the user didn’t specify the certain port number before they copy files between devices. To complete the file copying process successfully, you must forward correct port in advance.
  • File permissions settings are not correct: if the permission of a file is set to read-only, it means you can only access the file and look for information you need. You are not allowed to copy or move it unless the Read and Write permissions are offered for the file.
  • Login is not correct: the SCP error could occur when you are trying to copy files to certain desktop after you have logged into the server, not a regular file error scp. Why? That’s because the server will try to find the local path within it. In this case, you should log out of the server path to solve the problem.
  • Command is not correct: if the command you’re using to copy files between devices is not correct, you will encounter no such file or directory. You should go to modify the command to make it correct. Please remember that the command used to copy a certain file is not the same as that used to copy a whole directory.

How to Fix Secure Copy Protocol Error

* 1: identify the port number correctly.

If you’re not sure about the port number, you should use this command to copy files between devices since it can indicate the port number:

$ scp -P port_number [email protected]_remote_host:the_file /your/local/directory

It can be used to indicate port number when you are trying to copy files to a remote host (or from it).

Note: You should know that the “-P (Port not a regular file error scp should be added to the command and placed after the “$ scp” portion.

* 2: check and modify permissions.

As said earlier, you must make sure that enough permission is provided to the file you’re copying so as to avoid the Secure Copy Protocol error. So you should do the following things:

  1. Open File Explorer and navigate to the file you want to copy.
  2. Right click on the file and choose Properties.
  3. Uncheck the Read-only option under General tab.
  4. Click on the Apply button to confirm.
  5. Shift to the Security tab and check whether all the permissions are provided to the System and Administrator.
Read-only

How to fix when the File Explorer is not working/responding?

* 3: make sure the command you’re going to use is correct.

Here are some of the most commonly used commands for copying files.

Copy files from local host to remote host:

Copy files from remote host to local host:

That’s it. Do you know how to cope with no such file or directory now?

About The Author

Sarah

SarahFollow us

Position: Columnist

Sarah has been working as an editor at MiniTool since she graduated from university. Sarah aims at helping users with their computer problems such as disk errors and data loss. She feels a sense of accomplishment to see that users get their issues fixed relying on her articles. Besides, she likes to make friends and listen to music after work.

User Comments :

Error using SCP: "not a regular file"

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 not a regular file error scp like their target when it an application is accessing the content of the file.

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

If 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, not a regular file error scp. It's the colon that separates the host name from the remote path. You'll need to specify a destination as well.

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

If you want to copy the remote file to the same location locally, you need to repeat the path. You can have your shell does the work not a regular file error scp repeating for you (less typing, less not a regular file error scp

0 Comments

Leave a Comment