Posts Tagged ‘pam’

How to handle SVN with Redmine

septembre 15th, 2011

When it comes to project management, Redmine is one of the best tools according to me. Written in Ruby on Rails, it offers a huge amount of features in a clean, really nice and efficient interface. Plus it’s free and open source.

One of these features is related to Subversion. Redmine is able to interact with Subversion:

  • it has a powerful repository browser able to link tasks and commits.
  • it can manage SVN authentication. Redmine users have therefore access to the SVN repository with same username and password

In order to setup up this feature, you must follow this tutorial: http://www.redmine.org/projects/redmine/wiki/HowTo_to_handle_SVN_repositories_creation_and_access_control_with_Redmine

Sadly, this is not that simple. This tutorial doesn’t work on recent versions of Redmine (see post here: http://www.redmine.org/boards/2/topics/24383?r=26204). Redmine has updated it authentication system in adding a salt field. Initially, Redmine passwords were SHA1(password) only. Now passwords are SHA1(salt.SHA1(password)). This format is not supported by pam_mysql out of the box.

I’ve therefore patched pam_mysql.c. Patch is here: http://pastebin.com/4SATdQ8u

In order to use it, you must:

  1. download pam_mysql source here
  2. apply the attached patch on pam_mysql.c using the « patch » command
  3. compile again pam_mysql: « make clean && make && make install »
  4. modify the MySQL ssh_users view running this SQL query:
    CREATE OR REPLACE VIEW ssh_users as
    select login as username, CONCAT(hashed_password, '|', salt) as password
    from users
    where status = 1;
  5. edit /etc/pam.d/sshd and set crypt=5 for the 3 blocks

Auth will now take the salt into account. For pam_mysql-0.7RC1 only.
Let me know whether it works

Tags: , , , , ,
Posted in System, Technology | Comments (0)