Transferring a makefile using PUTTY scp - putty

I've written a makefile and I am trying to send it to the folder containing the program I am trying to compile.
the command I am trying is:
scp username#host.com ~/destinationdirectory C\Users\Myname\Desktop\Makefile
the response I get is:
ssh: Could not resolve hostname C: Name or service not known
lost connection
any thoughts on how I can get this to work?

The command syntax is:
scp <source> user#host:destination
With that, you may try:
scp C\Users\Myname\Desktop\Makefile username#host.com:destinationdirectory/

I don't use windows, so this might not work for you, but try the following:
scp username#host.com:/home/username/destinationdirectory C\Users\Myname\Desktop\Makefile

Related

How do I pass a full sftp url to the sftp command?

I have a website that provides sftp links in the format sftp://user#host.com/path/to/file.zip. To get this working via command line, I need to copy the link, and either run sftp user#host and then paste the path into the resulting shell:
$ > get /path/to/file.zip
Or I need to manipulate the url into something like sftp user#host.com:/path/to/file/zip
Today I saw someone just run sftp sftp://user#host.com/path/to/file.zip and it worked just fine. When I do this it seems that sftp interprets the file path as part of the host and says
ssh: Could not resolve hostname host.com/path/to/file.zip
How can I get it working such that I can just run this? sftp sftp://user#host.com/path/to/file.zip
The URL syntax is supported by OpenSSH 7.7 and newer only.
As OpenSSH 7.7 is relatively new (2018-04-02), it is quite probable that you are using an older version.
Se also a related question Using sftp like scp.

Copy file from remote to local using ssh

I'm trying to copy a file from a Ubuntu server to my mac but I keep receiving a No such file or directory error.
After I ssh in I'm using:
scp -p 8888 me#xx1.xx1.xx1.xx1:/var/www/html/00000001.jpg /Users/myusername/Documents/
But receive the error:
/Users/myusername/Documents/: No such file or directory
Is this error telling me that there is no such file or directory on my local machine? Any advice as to how to fix would be greatly appreciated.
Don't ssh in to your server first. Just execute that scp command from your local machine.
EDIT:
Also, the -p should be capitalized (according to the manpage on my machine), so:
scp -P 8888 your_username#remotehost.edu:/var/www/html/00000001.jpg /Users/myusername/Documents/
Yes, it's talking about your local machine. I'm guessing that you might have just typed something wrong. Try doing it like this instead:
scp -P 8888 me#xx1.xx1.xx1.xx1:/var/www/html/00000001.jpg ~/Documents/
Make sure you're typing this command at your Mac OS X Terminal prompt, not on the actual remote server. xx1.xx1.xx1.xx1 should be the remote Ubuntu machine ("pull" the file down to your machine, don't try to "push" it).
Also, although it's ssh -p, it's scp -P. For scp, -p just preserves modification times, and -P is the port.
Maybe you have multiple ssh connections open.
Try close all other connections and restart the scp command.

How to copy files from one machine to another machine

I want to copy /home/cmind012/m.sh from one system to another system (both system Linux) using shell script.
Command $
scp /home/cmind012/m.sh cmind013:/home/cmind013/tanu
getting message
ssh: cmind013: Name or service not known
lost connection
It seems that cmind013 is not being resolved, I would try using first
nslookup cming013
and see what why donesn't it resolve.
It seems that you are missing the IP Address/Domain of the remote host. The format should be user#host:[directory]
You could do the following:
scp -r [directory/files] [remote host]:[destination directory]
ex: scp -r /var/www/html/* root#192.168.1.0:/var/www/html/
Try the following command:
scp /home/cmind012/m.sh denil#172.22.192.105:/home/denil/

how do make a correct scp copy in bash

my command is
scp .deploy/deploy.sh root#192.168.155.148
I double checked it with this forum
Transferring files over SSH
however it doesn't give any error, neither it does the copy.
I also do lot of ssh at root#192.168.155.148, without problem
am I missing something? even if I change the address to have a bad address, it doesn't give me error... but since ssh connect with the same root#... I guess the address should be fine
You need a colon at the end of the command,
scp .deploy/deploy.sh root#192.168.155.148:
Or, if you want to put it in another directory under /root/temporary, for example, try,
scp .deploy/deploy.sh root#192.168.155.148:./temporary

How would I construct a terminal command to download a folder with wget from a Media Temple (gs) server?

I'm trying to download a folder using wget on the Terminal (I'm usin a Mac if that matters) because my ftp client sucks and keeps timing out. It doesn't stay connected for long. So I was wondering if I could use wget to connect via ftp protocol to the server to download the directory in question. I have searched around in the internet for this and have attempted to write the command but it keeps failing. So assuming the following:
ftp username is: serveradmin#mydomain.ca
ftp host is: ftp.s12345.gridserver.com
ftp password is: somepassword
I have tried to write the command in the following ways:
wget -r ftp://serveradmin#mydomain.ca:somepassword#s12345.gridserver.com/path/to/desired/folder/
wget -r ftp://serveradmin:somepassword#s12345.gridserver.com/path/to/desired/folder/
When I try the first way I get this error:
Bad port number.
When I try the second way I get a little further but I get this error:
Resolving s12345.gridserver.com... 71.46.226.79
Connecting to s12345.gridserver.com|71.46.226.79|:21... connected.
Logging in as serveradmin ...
Login incorrect.
What could I be doing wrong?
Use scp on the Mac instead, it will probably work much nicer.
scp -r user#mediatemplehost.net:/folder/path /local/path

Resources