SVN сервер на Debian c SALS

Краткая инструкция, как установить SVN сервер на Debian с использованием авторизации SALS.


sudo apt-get install libsasl2-2 libsasl2-modules sasl2-bin
sudo vim /etc/default/saslauthd
        # change the row that says START=no to START=yes

cd /svn/root
sudo svnadmin create newrepo
sudo vim newrepo/conf/svnserve.conf
        # insert the following
        anon-access = none
        auth-access = write
        # realmname may not contain special chars (this includes spaces,
 dashes and pretty much anything except a through z)
        realm = realmname
        use-sasl = true
        min-encryption = 256
        max-encryption = 256
        # EOF

sudo vim /usr/lib/sasl2/svn.conf
        # this is the basic setup.. alotta settings can be used
        pwcheck_method: auxprop
        auxprop_plugin: sasldb
        # i used /etc/svn_sasldb here
        sasldb_path: /path/db_name
        mech_list: DIGEST-MD5
        # EOF

sudo ln -s /usr/lib/sasl2/svn.conf /usr/lib/sasl2/subversion.conf
# add as many users as you need
sudo saslpasswd2 -f /path/db_name -c -u realmname username
sudo /etc/init.d/svnserve restart

# and ya done!!

Как создать контейнер для proxmox

Делаю контейнер Debian 6 с предустановленным mc и настроенным на utf8 в Московской временной зоне.


Step 1) Create a virtual machine using whatever template you like.
Step 2) enter the virtual machine (vzctl enter CTID)
where CTID is the ID of the virtual machine
Step 3) Install/remove any software you want:

  1. Обновляем и настраиваем Utf8 и русскую локаль
    1. apt-get update
    2. apt-get upgrade
    3. apt-get install aptitude
    4. dpkg-reconfigure locales  (выбираем ru_UTF8)
    5. su (перезаходим, что бы изменения вступили в силу)
    6. apt-get install mc (устанавливаем mc)
  2. Устанавливаем временную зону Москвы, что бы показывал московское время
    1. # rm /etc/localtime
    2. # ln -s /usr/share/zoneinfo/Europe/Moscow /etc/localtime

Step 4) Exit out of the virtual machine (but do not stop it)
Step 5) remove the ip address from the virtual machine
vzctl set CTID —ipdel all —save
or use the web interface to remove the ip address
Step 6) Stop the virtual machine
vzctl stop CTID
or use the web interface
Step 7) change directory to the virtual machines directory
cd /var/lib/vz/private/CTID
Step 8) tar the directory
tar –czvf /var/lib/vz/template/cache/debian-6.0-standard.ru.utf8_6.0-4_i386.tar.gz .
Note: the commands ends with a space followed by a period
Make sure you are in the directory for the virtual container


Подробее можно почитать тут: http://forum.proxmox.com/threads/452-Creating-custom-templates


Настройка csync2


Установка должна быть произведена на всех нодах кластера:

Из репозиториев debian\ubuntu

apt-get install csync2 sqlite rsync –y

сгенерировать сертификат вручную:
openssl genrsa -out /etc/csync2_ssl_key.pem 1024
openssl req -new -key /etc/csync2_ssl_key.pem -out /etc/csync2_ssl_cert.csr
openssl x509 -req -days 600 -in /etc/csync2_ssl_cert.csr -signkey /etc/csync2_ssl_key.pem -out /etc/csync2_ssl_cert.pem

После чего нужно запустить генерацию ключа csync2:
csync2 -k /etc/csync2.cluster.key

Continue Reading


Настройка iptables на VPS c Debian 6

Не успел установить VPS и настроить WEB сервер, как обнаружил, что огромное количество спамеров пытаются разослать через мой postfix всякую гадость. Плюс постоянно стараются подобрать пароль к SSH. А у меня сервер на Cloud хостинге, где плачу за все телодвижения, в том числе за совсем не нужные нагрузки.

Так порывшись в сети нашел следующие, на мой взгляд достаточные, настойки iptables.

1. Для начала создайте исполняемый файл:



Continue Reading


Авторизация без пароля OpenSSH

Because OpenSSH allows you to run commands on remote systems, showing you the results directly, as well as just logging in to systems it’s ideal for automating common tasks with shellscripts and cronjobs. One thing that you probably won’t want is to do though is store the remote system’s password in the script. Instead you’ll want to setup SSH so that you can login securely without having to give a password.

Thankfully this is very straightforward, with the use of public keys.

To enable the remote login you create a pair of keys, one of which you simply append to a file upon the remote system. When this is done you’ll then be able to login without being prompted for a password — and this also includes any cronjobs you have setup to run.

If you don’t already have a keypair generated you’ll first of all need to create one.

If you do have a keypair handy already you can keep using that, by default the keys will be stored in one of the following pair of files:

  • ~/.ssh/identity and ~/.ssh/identity.pub
    • (This is an older DSA key).
  • ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub
    • (This is a newer RSA key).

If you have neither of the two files then you should generate one. The DSA-style keys are older ones, and should probably be ignored in favour of the newer RSA keytypes (unless you’re looking at connecting to an outdated installation of OpenSSH). We’ll use the RSA keytype in the following example.

To generate a new keypair you run the following command:

skx@lappy:~$ ssh-keygen -t rsa

This will prompt you for a location to save the keys, and a pass-phrase:

Generating public/private rsa key pair. Enter file in which to save the key (/home/skx/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/skx/.ssh/id_rsa. Your public key has been saved in /home/skx/.ssh/id_rsa.pub.

If you accept the defaults you’ll have a pair of files created, as shown above, with no passphrase. This means that the key files can be used as they are, without being "unlocked" with a password first. If you’re wishing to automate things this is what you want.

Now that you have a pair of keyfiles generated, or pre-existing, you need to append the contents of the .pub file to the correct location on the remote server.

Assuming that you wish to login to the machine called mystery from your current host with the id_rsa and id_rsa.pub files you’ve just generated you should run the following command:

ssh-copy-id -i ~/.ssh/id_rsa.pub username@mystery

This will prompt you for the login password for the host, then copy the keyfile for you, creating the correct directory and fixing the permissions as necessary.

The contents of the keyfile will be appended to the file ~/.ssh/authorized_keys2 for RSA keys, and ~/.ssh/authorised_keys for the older DSA key types.

Once this has been done you should be able to login remotely, and run commands, without being prompted for a password:

skx@lappy:~$ ssh mystery uptime 09:52:50 up 96 days, 13:45, 0 users, load average: 0.00, 0.00, 0.00