Codier
Codier

Reputation: 2160

Use terminal in Mac for file transfer

I am using terminal in Mac for SSH access and it is great. But is there any way for me to do file transfer with the remote server that I SSH into in Mac? Thanks

Upvotes: 1

Views: 1316

Answers (2)

BillyBBone
BillyBBone

Reputation: 3324

(I realize this is a late reply, but I just stumbled upon this question and thought I'd contribute a tip...)

A quick & dirty way of transferring files over Terminal is:

On the remote side:

cat $file | openssl enc -base64

This will output a bunch of uppercase/lowercase/digits which represent Base64-encoded binary data. Select & copy this block text.

Then, in a separate Terminal window on your local machine:

pbpaste | openssl enc -base64 -d > $file

This will pipe the contents of the clipboard (the Base64-encoded data) to the openssl program (which is set to decode via the -d flag), and save the results in $file.

This works best for small files, and isn't terribly fast. I use it when I'm too lazy to construct a command line for scp or sftp. For larger/multiple files, you'll definitely want to use the latter two.

Upvotes: 0

JohnSmith
JohnSmith

Reputation: 4688

scp is your friend, enough said :)

Upvotes: 2

Related Questions