How to upload a file using the SCP command?

New to Puppy and have questions? Start here

Moderator: Forum moderators

Post Reply
OldAcer
Posts: 12
Joined: Mon Mar 08, 2021 8:27 am
Been thanked: 1 time

How to upload a file using the SCP command?

Post by OldAcer »

I've used the scp (secure copy) command from a console window a few times, to download files from a remote Linux system. It would ask for the password for the remote system as it is supposed to.
But when I tried to upload a file, the command responds with a ">" prompt and echoes anything typed; a CR just gets another prompt. Only way to quit is control-c, and nothing is transferred.

The command used was scp -P 22 localfilename user@host:/full/path/to/dest/directory/.
I also tried using a full path (from the pwd command) with the local filename.
Adding -v (verbose) to the command does not get any more output.

I tried looking for "SCP interactive mode" but did not find anything.

What is it doing and what am I doing wrong?

User avatar
01micko
Posts: 135
Joined: Mon Jul 13, 2020 4:08 am
Location: Qld
Has thanked: 5 times
Been thanked: 66 times
Contact:

Re: SCP command help

Post by 01micko »

What exact version of puppy do you use?

It may only have dropbear which does a good job as a light weight ssh replacement but is not a full replacement.

User avatar
Trapster
Posts: 176
Joined: Sat Aug 01, 2020 7:44 pm
Has thanked: 1 time
Been thanked: 45 times

Re: SCP command help

Post by Trapster »

Try the remote's password at the prompt.

OldAcer
Posts: 12
Joined: Mon Mar 08, 2021 8:27 am
Been thanked: 1 time

Re: How to upload a file using the SCP command?

Post by OldAcer »

This is the scp in Xenial 7.5 (?) (menu doesn't give exact version).
The SSH GUI works good, authentication agent forwarding, no options needed. And scp worked before.
The "prompt" doesn't seem to be for any parameter- tried the password first thing, you can go for many lines and same thing.
Thought maybe it was trying to transfer what you typed at the console, but found no evidence.
Is there another command to stop? Maybe control-c was cutting off the verbose info?

User avatar
ThruHammer
Posts: 257
Joined: Sun Jul 12, 2020 1:08 am
Location: Ray Brook, NY
Been thanked: 14 times

Re: How to upload a file using the SCP command?

Post by ThruHammer »

OldAcer
Posts: 12
Joined: Mon Mar 08, 2021 8:27 am
Been thanked: 1 time

Re: How to upload a file using the SCP command?

Post by OldAcer »

The download worked fine. And when it didn't (due to incorrect arguments) it would say it had a problem, like "scp: .: not a regular file cp: cannot stat '/big....".
If ">" is the console-stream, what is the end-of-file character to use?

User avatar
ThruHammer
Posts: 257
Joined: Sun Jul 12, 2020 1:08 am
Location: Ray Brook, NY
Been thanked: 14 times

Re: How to upload a file using the SCP command?

Post by ThruHammer »

Since I don't understand the particulars of your questioning, maybe either of these explain what you're after.

https://unix.stackexchange.com/questions/315151/whats-the-last-character-in-a-file

https://stackoverflow.com/questions/23765392/file-input-and-output-stream-in-c

User avatar
Trapster
Posts: 176
Joined: Sat Aug 01, 2020 7:44 pm
Has thanked: 1 time
Been thanked: 45 times

Re: How to upload a file using the SCP command?

Post by Trapster »

Please post exactly what command or total script that you are using.
ex. scp /local/file user@XXX.XX.XX.XX:/remote/dir

It seems you may have an extra (or missing) character that scp is waiting for ??

OldAcer
Posts: 12
Joined: Mon Mar 08, 2021 8:27 am
Been thanked: 1 time

Re: How to upload a file using the SCP command?

Post by OldAcer »

Trapster wrote: Tue Mar 09, 2021 2:24 pm

Please post exactly what command or total script that you are using.

From a console window,
scp -P 22 [user]@[remotedomain]: [remotepathandfilename] [localpathanddirectory]
gives a request for Password; after that is typed, it give an error message:
scp: .:not a regular file
cp: cannot stat '[remotepathandfilename]': No such file or directory
because I left a space after the colon.

Once the space is removed, the download works fine.

Now, when I try
scp -P 22 [localpathandfilename] [user]@[remotedomain]:[remotepath]
it asks for the password,
and then says
[localfilename] 100% [filesize] [speed]KB/s [time]
that is, it works correctly!

A few weeks ago, I thought I copied that console window to a file, but I can't find it. I had spent an hour trying different versions (of what I thought was the above) looking for a syntax error but it always just responded
" > " and echoed everything until I typed Ctrl-C to stop the command.

ThruHammer wrote: Mon Mar 08, 2021 8:41 pm

Do either of these help?

Yes! Crtl-Z was what I was thinking of from CPM, but Ctrl-d works in Puppy.

There must have been something bad about my local path. Now that I know about Ctrl-d, I'll see what happens if I have the problem again.

Since a lot of "guest" wifi connections don't allow FTP of any kind, SCP is real handy.

Thanks for the help with this.

Post Reply

Return to “Beginners Help”