Blog Navigation
Partners
Latest Activity
Phil gives the source code for implementing a MySQL singleton class in both PHP and Python.
Posted on: January 25th, 2011 by Famous Phil
I was too lazy to take screenshots so I decided to attempt a video blog. Hopefully future video blogs will be shorter
Content:
Tags: keys, openssh, passwordless login, ppk, putty, puttygen, ssh
Posted in Hosting / Server Administration
|| No Comments »
Posted on: February 2nd, 2010 by Famous Phil
This post is going to be short, sweet, and to the point
It seems that every time I build a new server, I’m constantly at a loss for memorizing the commands that generate public keys in SSH (Secure Shell). SSH for the computer illiterate is the Linux equivalent to Windows Telnet Services. This basically gives you a command prompt that is running on a remote computer.
SSH is the heart and soul of linux based computers because *everything* can be done through the command line simply. Unfortunately, Windows is just starting to catch up with Telnet using a new application called powershell. Powershell is very unlike the linux command line though since it is more a scripting language than a command based language. This is why I always scratch my head when working with Microsoft Exchange Server’s Powershell commands and end up reverting to the famous Microsoft graphical administration interface which gives me the option of “next next next finish”. I really do appreciate the Microsoft wizards that make software so easy to administer. Anyways, Linux never started with a graphical desktop (Unlike Windows and Macintosh), therefore, the command line in linux is far easier to use when administering a system.
To get back to my original topic, I am a fan of passwordless entry into my own systems. With linux and SSH, there are a few authentication methods, 1 being password entry, and 2 being public key authentication. With a password login, you basically enter a username and password and you are logged into a command prompt on linux.
With public key authentication, you generate 2 keys at your local computer, one being a private key and the other being a public key. Basically, you give the server you wish to connect to the public key, and only you hold onto the private key. When you connect to the server, it will first give you the public key so that you can verify that the server is actually the server that you want to connect to. This will be ignored on the first connect, but in the future, if this key changes, you will be notified that the server was possibly compromised. Upon allowing the connection, you will give the server your private key and it will run some calculations on the key you provided. If the result matches that of the server’s public key, you will be granted access. Since keys are generally 256 hexadecimal characters long, these are much more secure than normal passwords, and they are generally much easier to use (unless your laptop is stolen).
So now onto how to actually use these keys:
1. Generate the key on your local machine (not the remote machine).
A. ssh-keygen -t rsa
2. Verify that your remote server has an ~/.ssh directory. ~ in linux is the home directory.
3. Copy the local public key to the server
A. This can be done with: scp ~/.ssh/id_rsa.pub user@remote_server:~/.ssh/authorized_keys2
B. Notice I specified authorized_keys2… this is actually for SSH Protocol 2 which is a more secure SSH protocol than the original.
C. scp is secure copy in linux and it copies files between computers using SSH tunnels.
4. Attempt to ssh into your remote machine. It should not need a password anymore.
A. ssh user@remote_server
Hopefully this helps make sense of SSH keys.
Afterthought on 2/4/10:
when using the scp command as a copy / paste above, this will overwrite your authorized_keys2 file on the remote computer. To prevent this from happening, append to the file using this command (thanks Cris for pointing this out to me):
cat ~/.ssh/id_rsa.pub | user@remote_server “cat >> ~/.ssh/authorized_keys2“
Tags: key, keygen, Linux, ssh
Posted in Hosting / Server Administration
|| 6 Comments »
Posted on: April 25th, 2009 by Famous Phil
The other night, I was working on installing a new RSS feed reader that is similar to Google Reader. I first found out about Google Reader from a friend (Chris) here at my University over a lunch. I then looked at it and discovered that it is much better than going to each and every blog site and reading the posts on each blog directly. This reader basically gathers all of the full text blogs and puts them in an email interface format, making it extremely easy and painless to read a bunch of RSS feeds while on the go (for me, on my windows mobile smart phone on the bus going to class or during dinner when I’m too lazy to get up and return to my room).
Anyways, I am not a real fan of using everything Google when I have an alternative that runs in ssh and doesn’t require an additional login (or saved password). I found 2 alternatives that run in ssh, one is snownews and the other is newsbeuter. Both of these programs are extremely simple and do exactly what google reader does, but they run in the SSH window like Pine or Pico does (Pine is an ssh email client, and pico is an ssh text editor). Snownews is not really good at reading rss feeds because it looks at the description tag of RSS 2.0 feeds which only puts a brief outline of the feed on the screen. Newsbeuter is much better and places the full content of a post on your screen like Google Reader does.
So, what does newsbeuter look like?
Here is the Main Screen, a main listing from a single rss feed, and a single blog post from an rss feed:
When I was configuring newsbeuter, my main concern was, “would it read a full feed that is in the rss file, or would it just show the description cropped by [...] like snownews did”. Because I compiled this on my server from source, I didn’t want to waste effort installing dependancies (a compiling problem) if it wouldn’t work in the end.
Luckily, it did read full rss feeds, except for John’s blog. I asked John what was different about his blog, and he told me he turned off full text rss feeds. His reasoning is, rss feeds make it very easy for someone else to post dynamic changing content on their own websites. While I totally understand this concern, I really wonder if it will kill off readership to his site, which I know he might eventually want to make money off from some day. I know for sure that I want famousphil.com to eventually make money for itself although I’m still debating how to put ads on it without hurting the design (which will be changing in a month or two again to make it easier to read).
I have looked at several blogs debating rull text vs partial text feeds (they aren’t hard to find), including the following:
For me, I will probably keep his blog on my feed list and look at his teasers. I will probably not actually read any more than his teasers though (mostly because I don’t have time to go look at these other sites that feel too smart to post a full feed). I don’t use other people’s content for my blogs normally without citing then adding significant material onto their blogs, therefore, I don’t consider myself a blog theif either. I do however visit other sites if I feel like leaving a comment
Finally, with wordpress, if you use a “more” tag, this material will not show up on your blog feed. I will likely begin using this a bit (only after my site becomes eye friendly) because I do have long blogs and sometimes that material is an aid, but not necessary to know everything about my blog. If people want to read the aiding material, then they can then visit my site.
As for this blog, always expect a full feed, if there isn’t one, I will do everything I can to help. Comments are appreciated as always
If you host with me, feel free to use these programs I mentioned as they are installed on the main server
Tags: blog, content, description, feed, full, newsbeuter, partial, pico, pine, rss, snownews, ssh
Posted in Hosting / Server Administration, Mobile Technology, My Site, Personal, Technology
|| 3 Comments »
Posted on: April 15th, 2009 by Famous Phil
You can purchase expandrive at: http://expandrive.com
I bought sftpdrive (the old name) about 8 months now after looking for a solution to hot edit php files on my web server so I could effectively develop remotely while having the local development feel. Shortly after I got this program, I shared it with John, who then shared it with Jordan who recently blogged about it here.
I will leave the screenshots to Jordan, but I have never had a problem with this program. I now use it for all of my development needs and it has never failed me. The best part is that this program is easy, many programs that interface windows to linux are not easy!
So thats my pitch for expandrive
Hopefully they can make a few more hundred bucks off from this blog
Tags: expandrive, file transfer, sftp, sftpdrive, ssh
Posted in Hosting / Server Administration, My Site, Personal, Programming, Technology
|| 1 Comment »