"So there are Oliphaunts. But no one at home will ever believe me."
Random header image... Refresh for more!

Some UNIX Marbles

Some tricks I’ve used recently.

  1. Suppose you want to enable non-interactive (that is, “passwordless”) login to a remote host using ssh. This happens all the time, right? If you follow the usual steps, or the man page, there is a good chance it will fail on you without explanation. This is because ssh silently croaks when it discovers that your ~/.ssh directory is group or globally readable. To fix it, just
    chmod 700 ~/.ssh

    and you’re done. Some helpful links:

  2. File transfer (ftp, scp, http, whatever) interrupted from a known host? Resume file copy using rsync. You just supply the –progress argument point rsync to the source file. Found this tip at a defunct Danish blog. Sample usage:

    rsync --progress --rsh=ssh "joe@joesdiner.com:mydir/myfile" .

    Note that the destination is required, so to resume in the working directory use . as above. rsync will compare the two files and resume copying at the break.

  3. Setting (or spoofing) your Machine Address Code (MAC) on OS X? Use the ifconfig command, passing lladdr with your new, colon-delimited MAC. This needs to be done as root, so sudo is required. Sample usage:

    sudo ifconfig en0 lladdr 00:11:22:33:44:55

    Used on OS X 10.6 but I’m sure it works on any POSIX system. I looked this up for a friend because his, er, off-brand (Iraqi) router insisted that his MAC was invalid, so it couldn’t be entered into the MAC filter table. Odd. Found here.