Saturday, 9 October 2021

How to copy files from Ubuntu to Mac

If remote login is not enabled on Mac, SSH connection will fail:

~/Videos$ scp -r MyDir/ user@192.168.0.30:/Users/user/Movies
ssh: connect to host 192.168.0.30 port 22: Connection refused
lost connection

We need to enable remote login on Mac (System Preferences >>  Sharing):



~/Videos$ scp -r MyDiruser@192.168.0.30:/Users/user/Movies
The authenticity of host '192.168.0.30 (192.168.0.30)' can't be established.
ECDSA key fingerprint is SHA256:fvlF0KH/l1N/fHmg4etTM/OR9DJYl1mnzD2iD43R+j5.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.0.30' (ECDSA) to the list of known hosts.
Password:
file1.m4v         100%  137MB   1.6MB/s   01:28    
file2.m4v         100%  151MB   1.5MB/s   01:40    

Files are copied to /Users/user/Movies/MyDir/.