July 17th, 2007
The purpose of this command is to create public/private ssh key pairs. The public key generated locally can then be uploaded to a remote host and added to the “authorized_keys” file. ( Install openssh first.)
mistakes I’ve made:
- When I first tried this, I thought I was supposed to run ssh-keygen on the remote host. You can run it anywhere, actually. Run this command locally and then upload the public key (*.pub) portion to the remote host. Or, run it on the remote host and download the private portion to the client.
- When using a Windows client to connect to a linux server, use ssh-keygen instead of puttygen. This is how I got around the “server refused our key” frustration. Read this excellent post for more info.
- The most common mistake I make is that I might be “jsmith” on the remote host and root on the local machine. So, when I do keygen on the local machine, it creates a public key for root that won’t work when trying to authenticate as jsmith.
to get around this, make sure you are running the ssh-keygen command as the user that will be authenticating to the remote host.
- If I replace authorized_keys with my new public key string, then I’ve blown away any ssh connections for my other machines that depend on connections to this remote host. authorized_keys can hold many public keys.
- Even though every ssh site warns about this, I still forget to make sure permissions on the remote host for .ssh directory and the authorized_keys file are set correctly. (
chmod 600 .ssh and chmod 700 .ssh/authorized_keys )
- I could not get the rsa1 key type to work. RSA1 is used by the SSH 1 protocol only, and everything these days is SSH 2
If you do not specify the filename for the keys, the command asks you for a filename and makes a default called id_dsa and id_dsa.pub (or id_rsa and id_rsa.pub if using rsa) in /home/jsmith/.ssh/ if you do not give one. These defaults work just fine.
to give it your own name and save it right to the directory you are working in:
ssh-keygen -t rsa -f mykey
to give it your own name and save it somewhere else:
ssh-keygen -t rsa -f /home/jsmith/mykey
the -t option is required. The choices are rsa and dsa.
After this command is issued, the program will ask you for a pass phrase. Leave it blank if you need programs that use these keys to not use password / passphrase authentication and the mere presence of the private key file is enough to allow access.
Posted in linux | No Comments »
June 27th, 2007
I’ve been wanting to review the boot messages that fly by when linux is booting. I found that the command dmesg does just this. and to load it into a file, of course, do dmesg > bootmessages.txt
Posted in linux | 2 Comments »
June 6th, 2007
- Even though the release stays at 3.0, there are many builds with bug fixes and other important updates. To get these, run “Online Update”. Update: I just realized that Online Update isn’t used anymore…To get the latest updates, use SVN
- In setting up db_autopwn, I initially used a postgres database with ASCII encoding. This apparently caused some errors that went away when I used a new database with UTF8 encoding
- db_create args did not work for me, so I grabbed the postgres.sql out of the data directory of my Windows installation and ran that SQL directly in a postgres client. That seemed to work
- When running db_autopwn, I still get the following error:
An error occurred in the console reader: SyntaxError: missing } in XML expression
- Debugging the metasploit code: You can edit the *.rb files to print out values of variables ( print_status(”I am a debug statement”) will output messages to the metasploit console)
- you can also create a Logger very similar to the Log4J:
put
MSF_LOGGER = Logger.new("#{RAILS_ROOT}/log/msf.log")
MSF_LOGGER.level = Logger::DEBUG
in environment.rb
and then anywhere you want to log some messages, put a line like MSF_LOGGER.debug(”hello from ruby”)
as described here
Posted in metasploit | No Comments »
May 21st, 2007
This is version 10.0 of suse.
- get ruby rpm. I got my version here.
- verify ruby install by typing
ruby -version at the command line
- get rubygems rpm (I got mine here)
- at command line type
gem install -v=1.2.2 rails -y (must first su to root to do this)
- download metasploit.
- navigate to directory where you saved framework 3.0 and extract it
- navigate to framework-3.0 directory and type
./msfweb
- point your browser at http://127.0.0.1:55555 and you will see metasploit web interface!
Posted in linux, metasploit, suse | No Comments »
April 26th, 2007
we had a number of changes to use the most recent FOP (0.93) version with OFBIZ:
- image size needs to be defined in template files (xxxx.fo.ftl) as content-height=”60mm”. Previously we had height=”60mm”. This syntax no longer works. We now need content-height=”60mm”
- in controller.xml , the proper FOP handler is now org.ofbiz.webapp.view.ScreenFopViewHandler
- to use ScreenFopViewHandler, the content type must be defined when calling this handler from the view-map tag: content-type=”application/pdf”
- also in the view-map tag, the encoding attribute should be set to “none” : encoding=”none”
Posted in ofbiz | No Comments »
March 13th, 2007
This means that you compiled your code with one JVM and are trying to run it with a different one. Either:
- change the version that is compiling your code
- change the version that is running your code
In my case, my code was compiled in Eclipse for Java 1.5 and I was trying to run it with 4.1 JVM
So pointing JAVA_HOME to the location of the 1.5 jdk directory should fix that problem. In my case:
export JAVA_HOME=/usr/bin/jdk1.5.0_11
For a great summary of java version issues, take a look at this article about “what version is your java code?”
How you can check which version your .class file has been compiled for: You can open up a .class file with a hex editor (you can use Textpad or the ehep hex editor plugin for eclipse) to see which major.minor version the class was compiled with. In hex format, a class file will begin with:
0x CA FE BA BE 00 00 00 2E
you have to convert the last byte, 2E, to decimal (=46)
According to the secret chart, this puts it at Java 3.1 compliance
0x CA FE BA BE 00 00 00 31
31 converts to 49 in decimal and that means Java version 1.5 compliance
Posted in ant, eclipse, java | No Comments »
March 12th, 2007
I recently quit writing about Information Technology on my other blog because it was boring half my readers to death. I’ll use this blog to write about the software tools and languages I use and to keep track of my projects and what I’ve learned.
Posted in Uncategorized | No Comments »