Philipps Blog

2011/11/20

Jenkins/Hudson Password Hash Format

Filed under: Java,Security — philipp @ 4:37 pm

Nice to know:

The Build-In Security Realm of Jenkins/Hudson is based on acegisecurity. The Hash is Sha256 based. For a Salt

foo

and a password

bar

, you have to Hash

bar{foo}

, that’s then

77ce9123f864f6749a2b2c99b988089c21d33e39247f7b1276dfad01a112f038

(via hashgenerator.de)

You find the Hashes in <Jenkins-Dir>/users/<username>/config.xml

it is then storred as

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user>
    <fullName>user</fullName>
    <properties>
        <jenkins.security.ApiTokenProperty>
            <apiToken>…</apiToken>
        </jenkins.security.ApiTokenProperty>
        <hudson.model.MyViewsProperty>
            <views>
                <hudson.model.AllView>
                    <owner reference="../../.."/>
                    <name>Alle</name>
                    <filterExecutors>false</filterExecutors>
                    <filterQueue>false</filterQueue>
                    <properties/>
                </hudson.model.AllView>
            </views>
        </hudson.model.MyViewsProperty>
        <hudson.security.HudsonPrivateSecurityRealm_-Details>
            <passwordHash>foo:77ce9123f864f6749a2b2c99b988089c21d33e39247f7b1276dfad01a112f038</passwordHash>
        </hudson.security.HudsonPrivateSecurityRealm_-Details>
        <hudson.tasks.Mailer_-UserProperty>
            <emailAddress>mail@example.com</emailAddress>
        </hudson.tasks.Mailer_-UserProperty>
    </properties>
</user>

 

2011/01/23

setup your public SSH key to another UNIX Host

Filed under: Security,Snippets — philipp @ 5:39 pm

Normally you would prefer to use your public ssh key for login into a remote linux machine.
I created a script to perform the basic steps for inserting your public key into the hosts authorized_keys files.

The script looks like this:

#!/bin/bash

HOST=$1;
echo ">> setup your ssh keys for $HOST"
echo ""
echo ">> creating ssh keys on $HOST if necessary"
echo "(you need to enter your password)"
echo ""
ssh $HOST 'if [ ! -d ~/.ssh  ] ; then ssh-keygen -t rsa; fi'
echo ""
PUBKEY=`cat ~/.ssh/id_dsa.pub`
echo "=========================================================="
echo "your id_dsa.pub:"
echo "$PUBKEY"
echo "=========================================================="
echo ""
echo ">> transfering your public ssh key"
scp ~/.ssh/authorized_keys $HOST:~/.ssh/authorized_keys
ssh $HOST 'chmod 600 ~/.ssh/authorized_keys'
echo ""
echo ">> login with your public key"
echo "(should work without a password)"
ssh $HOST

A typical run might look like this:

imotep:~ philipp$ setupssh philipp@192.168.178.55
>> setup your ssh keys for philipp@192.168.178.55

>> creating ssh keys on philipp@192.168.178.55 if necessary
(you need to enter your password)

The authenticity of host '192.168.178.55 (192.168.178.55)' can't be established.
RSA key fingerprint is ...
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.178.55' (RSA) to the list of known hosts.
philipp@192.168.178.55's password:
Enter file in which to save the key (/home/philipp/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Generating public/private rsa key pair.
Created directory '/home/philipp/.ssh'.
Your identification has been saved in /home/philipp/.ssh/id_rsa.
Your public key has been saved in /home/philipp/.ssh/id_rsa.pub.
The key fingerprint is:
... philipp@debian
The key's randomart image is:
+--[ RSA 2048]----+
|...              |
+-----------------+

==========================================================
your id_dsa.pub:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx......xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
==========================================================

>> transfering your public ssh key
philipp@192.168.178.55's password:
authorized_keys                                                                         100%  610     0.6KB/s   00:00    

>> login with your public key
(should work without a password)
Linux debian 2.6.26-2-amd64 #1 SMP Thu Nov 25 04:30:55 UTC 2010 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Jan 23 17:31:16 2011 from imotep.fritz.box
philipp@debian:~$

2007/11/12

tatsächlich….

Filed under: Mac,Security — philipp @ 5:02 pm

…. fast schon wieder n Jahr rum ;-)  Also irgendwie komme ich gar nicht mehr dazu hier was zu posten.Hat sich schon eine ganze Menge ereignet in letzter Zeit :-) Achja… heute dann mal in Deutsch wieder, irgendwie ist das Englische grade entfallen.Zuallererst:Ich habe endlich ein Macbook und es ist soooo schön! Zwar in weiß (und langsam zeigt sich, dass es Flecken anzieht),  aber es ist deutlich schneller als mein kleiner G4 Mac Mini.Da ich munter am einrichten des Systems bin, hier schon mal ein paar Hinweise: 1. Um in der iTunes Bibliothek die Links (die kleinen Pfeile) hinter den Interpreten/Alben so umzuwandeln, dass sie nicht in den iTunes Store führen, sondern in die eigene Bibliothek, muss man im Terminal folgenden Befehl ausführen:   

defaults write com.apple.iTunes invertStoreLinks -bool YES    

Möchte man das alte Verhalten wiederhaben (Option(=alt)-KLICK auf den Pfeil Button führt zur Bibiothek), so schreibt man:  

defaults write com.apple.iTunes invertStoreLinks -bool NO

 Gefunden im macwelt.de Forum [1]  Weiterhin gibt es eine erste Beta vom Mail Plugin:

 PGP for Apple’s Mail    

Diese Beta läuft nun auch wieder unter Macos 10.5 Leopard. Meinen gpg key findet ihr übrigens direkt unter meinem Foto. Man erhält diese Beta, indem man sich in die Mailingliste einträgt. Es läuft noch nicht alles perfekt, aber zumindest kann man gpg wieder schützen.Ich werde in der nächsten Zeit übrigens Beiträge zu folgenden Themen posten: 

  1. gpg – was ist das und wofür braucht man das
  2. ssh  - was ist das und wofür braucht man das
  3. ssh mit key files – der sichere Komfort

 Es ist zumindest ein kleiner Beitrag, ein wenig Information zu verbreiten, nachdem zumindest die Politik in Deutschland kein Interesse daran hat, den Schutz der persönlichen Daten weiterhin aufrecht zu erhalten. 

Powered by WordPress