Thursday, October 18, 2007

ssh troubles.. why is everything so hard?

Well, scping my gnucash files from venus to longstreet worked so well (when they were 4 feet apart) that I decided that I would move venus to my home and scp files from there back to longstreet at the office. You know - remote backup is better because of fire, theft, etc. Up until a few days ago, both my linux boxes (venus and longstreet) were at my office. So I bring venus home and plug it up. Eth0, my on-mobo ethernet port, fails to come up. I don't know what to do, so I install another ethernet card that I had laying around in a PCI slot inside venus. Now both eth0 and eth1 fail to come up. Eth0 was working perfectly when I left the office!!! So I take venus to the repair shop. The guy claims to know how to work on linux computers. Well.......

$165 later, he shows me that he can connect to his DSL ISP using venus (on eth1). So I get it home, and plug it up and ......same deal. Both eth0 and eth1 fail to come up. This upsets me terribly. So I unplug my Cisco 871w router from whence venus was supposed to gets its IP address (from dhcp) and plug venus straight into my Comcast cable modem. Now it works. I can surf the Net. So Fedora 6 on venus for some reason doesn't like the dhcp server on my router, but thinks it's OK to talk to the dhcp server at Comcast. Swell.

Now I unplug venus from the cable modem, plug the 871w back into the modem, and plug venus into one of the switchports on the 871w. Now I'm basically back where I started. As part of my "clutching at straws" procedure, I put into venus a DVD that I have that has several live versions of linux. You know...they work without having to be installed on your hard disk. I reboot into Damn Small Linux. Network configuration proceeds without a hitch and now eth1 is working fine!##$#$@%. I'm confused.......

Now I have to enter some stuff into gnucash on venus so I remove the live DVD and boot back into Fedora 6. You guessed it. Now eth1 works and everything is okey dokey.

All this has made me forget what I was origianlly trying to do. Oh yeah...now I remember. I was going to scp files from venus at home back to longstreet at the office. It seems like forever ago that I thought I could actually do that....

So I try it and it works!! (By "works", I mean that I can scp to longstreet over the Internet and NOT have to enter a password each time. I have a shell script that copies the files I want and I will ultimately put that into my crontab. I want to copy the files every night while I sleep; no waking up to enter a password each time!). Another network admin victory. But of course now I want to up the ante. I rented a linux box at The Planet.com. It is my own linux box with Cent 4 OS and a 160 GB hard drive and a public IP address. Very cool. It's probably out in California or some place....So now I want to scp to this linux box too. It works, but still asks for a password each time. I try everything I know about ssh-keygen -t rsa and copying id_rsa.pub to the .ssh directory on the server and putting it into authorized_keys and blah blah blah.....and it still demands that password each time.

I email tech support at The Planet, but they don't do hand holding for weak-unit sys admins. Lots of web searching later I find out that my directory permissions are set too permissive!!! Who knew? Usually you have to fight against firewalls and other devices that are set too restrictive. I didn't know SSH refuses to work if it thinks your system is too much of a pushover. So I change my permissions on /home/tayloe/.ssh/authorized_keys with chmod and try again. It works!

I'm tired of all these tawdry little problems preventing me from getting any real work done... Actually, for sys admins, there is no real work to be done in the ordinary sense. It's all fighting the wretched OS's and network weirdness. And my own cluelessness about permissions.....

chmod 600 /home/tayloe/.ssh/authorized_keys

chmod 700 /home/tayloe/.ssh

At first I did chmod 600 to my .ssh directory too, but I found that I could not even look at the contents of the directory. So as root, I changed it to 700. Now it's time for a chocolate milk shake at Chick Fillet....

No comments: