Posts By: jonny

1and1 Overcharging for Backups

So back in November 2013 1and 1 contacted me to tell me they would be physically moving my server from one data centre to another: In the email on the 3rd November they advised signing up for 1and1 Professional Backup. They advised that the backup service would be free for two months and would automatically… Read more »

Browsing the GitLab Omnibus Postgres Database

phpPgAdmin

After installing GitLab Omnibus edition I wanted to take a look at the database tables. To do so I installed phpPgAdmin (available in the EPEL repo): yum install phpPgAdmin I created a user in Postgres for use with phpPgAdmin: su – gitlab-psql /opt/gitlab/embedded/bin/psql gitlabhq_production gitlabhq_production=# CREATE USER jonny_test WITH PASSWORD ‘opensesame’; CREATE ROLE gitlabhq_production=# GRANT… Read more »

Restricting SSH Logins to LDAP Group

The are multiple methods of doing this including using pam but I settled for the following: In the /etc/ssh/sshd_config file I currently have: AuthorizedKeysCommand /usr/libexec/openssh/ssh-ldap-wrapper AuthorizedKeysCommandRunAs nobody to check for ssh keys for the user logging in and I also have password authentication disallowed. The content of the file /usr/libexec/openssh/ssh-ldap-wrapper was simply: exec /usr/libexec/openssh/ssh-ldap-helper -s… Read more »

Installing Darkstat on CentOS 6

Darkstat

The darkstat software is available in the rpmforge repository so you will need to install RPMforge first: rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm Then install Darkstat with: yum –enablerepo=rpmforge install darkstat My scenario was to use darkstat to monitor traffic on a local 192.168.161.* network so I used the following command: /usr/sbin/darkstat -i eth1 –no-dns -p 10001 -b… Read more »

pam_exec.so Execute Commands on User Login

In addition to the normal pam_mkhomedir.so I wanted to create a directory for each user on an alternative disk. To do so I edited: vi /etc/pam.d/password-auth added the line below (just above the line: session optional pam_mkhomedir.so) session     optional      pam_exec.so /usr/local/bin/create_dir.sh Then created the create_dir.sh file: vi /usr/local/bin/create_dir.sh and added the following: #!/bin/bash if [… Read more »

Gitlab Omnibus – Change the Nginx Port

Ignore original text below. The correct method is to amend the /etc/gitlab/gitlab.rb file with the port e.g.: external_url “https://gitlab.domain.co.uk:8443” nginx[‘ssl_certificate’] = “/etc/pki/tls/certs/pubkey.pem” nginx[‘ssl_certificate_key’] = “/etc/pki/tls/private/privkey.pem” Then run: gitlab-ctl reconfigure   Doing a ps -ef | grep nginx allowed me to track down the configuration file: /var/opt/gitlab/nginx/etc/gitlab-http.conf That file specified the port number (see below) and… Read more »

Rebuild Win 2008R2 Domain Controller with Same Name

ntdsutil

We recently needed to rebuild a Windows 2008R2 Domain Controller from scratch using the same name as it previously used. So we first needed to remove the existing server details from the Directory using ntdsutil as follows (copied from MS site): 1. Click Start, point to Programs, point to Accessories, and then click Command Prompt…. Read more »

Run Windows MMC as a different user

Windows runas command

While logged in to a Windows Desktop as a normal domain user (jonny) I wanted to be able to run the Active Directory Users and Computers snap-in as a Domain Admin user (adm-jonny) to do so requires using the ‘runas’ command. When I had first tried using the ‘runas’ command I had problems related to… Read more »