I am trying to copy a file from a remote machine to the local machine I am using. Whenever I run this command I get prompted to enter a password. I am not sure what to enter for the password as I never configured any password. Anyone have any tips?
scp stuff.php djorge@localhost:Users/djorge/Desktop
Copy or Download a File From Remote to Local Using SCP SCP syntax is pretty simple. Just invoke SCP followed by the remote username, @, the IP address or host, colon, and the path to the file. If not specified, the default path is the remote user's home directory.
To copy the files you will need to first invoke the SCP, followed by the remote username@IP address, path to file. If you do not specify the path, it is assumed as default in this case which will be the user's home directory, this will be followed the path where the file will be stored locally.
The scp command issued from the system where /home/me/Desktop resides is followed by the userid for the account on the remote server. You then add a ":" followed by the directory path and file name on the remote server, e.g., /somedir/table. Then add a space and the location to which you want to copy the file.
Another possibility is to try to salvage the scp you've already started when it stalls. ctrl+z to background and stop it, then ssh over to the receiving server and login, then exit. Now fg the scp process and watch it resume from 'stalled'!
You need the ip of the other pc and do:
scp user@ip_of_remote_pc:/home/user/stuff.php /Users/djorge/Desktop
it will ask you for 'user's password on the other pc.
There must be a user in the AllowUsers section, in the config file /etc/ssh/ssh_config, in the remote machine. You might have to restart sshd after editing the config file.
And then you can copy for example the file "test.txt" from a remote host to the local host
scp [email protected]:test.txt /local/dir
@cool_cs you can user ~ symbol ~/Users/djorge/Desktop if it's your home dir.
In UNIX, absolute paths must start with '/'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With