Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm newbie on FreeBSD.

I configured a BSD on VM for Erlang. For private use only, NOT for production service. It was very easy setup and installing, now I can call erl console.

Next, I want to upload my Erlang source file from my Mac into BSD. What kind of file transferring option available and suitable for my purpose?

share|improve this question
add comment

4 Answers

up vote 1 down vote accepted

I personally prefer copying via scp

scp /path/to/source/file username@otherbox:/path/to/desired/destination

or

scp username@otherbox:/path/to/file /path/to/destination
share|improve this answer
    
Is it possible batching scp command by passing passphrase as an option? –  Eonil Aug 27 '10 at 0:49
    
It'd be easier yet to use ssh keys; run ssh-keygen on the BSD box; then copy the ~/.ssh directory to your home folder on the Mac box. –  Chris S Aug 27 '10 at 1:19
    
Agreed, Chris, but since I he's asking about 'how to copy', I'd give him an answer and a tool now, and he can learn how keys work after he has his files where he needs them. @Eonil, Look into how SSH keys (and PKI) work. As Chris mentioned, this will make the scripting easier and eliminate the need to include the password. –  gWaldo Aug 27 '10 at 4:59
add comment

sftp is by far the easiest way to transfer a few files from one *nix to another.

On the BSD machine add sshd_enable="YES" to /etc/rc.conf; if you're not familiar with vi or emacs; this will work echo 'sshd_enable="YES"' >> /etc/rc.conf. Then run /etc/rc.d/sshd start (or reboot the machine, whatever).

On your Mac, open a console, type sftp [username]@[BSD_machine's IP], enter your password, then put [filename]. The file is now in your home directory on the BSD machine. Note: you must have a username besides 'root' to use sftp (add one with adduser if you don't have one already) and it must have a password.

Also, if the BSD machine has a file you want; same thing with starting sftp, then use get [filename] to transfer it back. Sftp works very much like normal ftp if you're familiar with that.

share|improve this answer
add comment

The easiest way, if you have a web browser on the BSD installation, might just be to take advantage of the web server in OSX. There's a summary here that ought to help.

You may also consider using NFS. There's a summary here for that.

I'd suggest the web server method is easier, especially if you have a browser running on the BSD install already and if this is just a case of sending a file one way on odd occasions.

share|improve this answer
add comment

If you're only transferring the occasional odd small configuration file, you can use ssh as a pipe. For example, if /home/username/foo.conf existed on your FreeBSD machine, you could type on the OS X machine terminal ssh <host> '(echo /home/username/foo.conf)' > localfoo.conf, which should pipe the contents of foo.conf to the file localfoo.conf on your OS X machine. Of course, replace <host> with the IP address or hostname of the machine you'd like to connect to.

To do it the other way, you'll require the ability to ssh into your OS X machine. Really not the best way to transfer files, but sufficient enough in a pinch.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.