I took a look around at other questions here and at various "scp usage" tutorials on Internet, but I can't sort out what's wrong.
I'm using Linux Mint and I'm trying to figure out how scp works.
I've a file file.ext (on my computer) in directory /home/name/dir/
I connect to a remote machine using ssh, like:
ssh -p 2222 username@domain
it asks me the password and the shell displays:
username@domain ~ $
now, If I issue the command (before I ran ssh I was in the local directory /home/name/dir ):
scp -r -P 2222 file.ext username@domain
cp: cannot stat ‘file.ext’: No such file or directory
Same result if instead of file.ext I write the complete path
scp -r -P 2222 /home/name/dir/file.ext username@domain
Also, the server admin told me that I shall upload the file to my remote home directory (instead of root), like:
scp -r -P 2222 file.ext username@domain:~/
but when I do it and press "Enter" nothing happens, as If the shell was waiting for further input.
Summary of my problems:
- cp: no such file or directory
- shell "stuck" on ~/