Sun, 30 Dec 2007

Here be monsters

Grr. There are unfathomable deeps surrounding authentication with the Wolfram smtp server when connecting from outside their network. My email will stay on my office computer, accessed via emacs through ssh X forwarding. Back to Mathematica coding - I've had enough lisp for the night.

On the bright side, I'm now using my new squeaky-clean & organized .emacs and .gnus files that I came up with during all this. A general cleanup can violate Grohens' Law of Information Conservation if you're not careful. I tossed code only if I couldn't remember what it was for or the last time I used it. It's still hanging around in old files, though, in case I really need some of it.

Thu, 25 Oct 2007

ssh without a password

Sometimes you need to be able to ssh to a server without giving it a password; say, if you have an automated process that writes files and copies them to a server. I had to set this up quite a few times recently - here's the recipe I followed (this assumes that the permissions on your various ~/.ssh directories are correct)

You'll need:

  • a client: a computer from which you'll ssh to another
  • a server: the computer to which you'll ssh from a client

Then,

  • on the client, run 'ssh-keygen -t rsa' to generate ~/.ssh/id_rsa.pub and associated files. When asked for a password, just hit Enter. You need to generate id_rsa.pub only once per client - you can reuse it for each of the servers.
  • scp ~/.ssh/id_rsa.pub server:~/.ssh/client.pub
  • ssh server
  • supply your password to get in
  • cd ~/.ssh
  • cat client.pub >> authorized_keys
  • if this creates a new authorized_keys file, change its permissions to 600: chmod 600 authorized_keys
  • log out of the server & try to ssh to it - you should get in without having to specify a password
  • of course this is less secure than ssh with a password, so use it wisely and sparingly
  • your mileage may vary - some installations may require a file named authorized_keys2; the above recipe works for me in my environment.

A facility for quotation covers the absence of original thought.—Lord Peter Wimsey

Left column Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.