LDAP authentication with ProFTPd on FreeBSD 11.2

You can use LDAP authentication with ProFTPd. Simply install proftpd-mod_ldap with

# pkg install proftpd-mod_ldap

afterwards edit your proftpd.conf file an enable ldap authen:

LoadModule mod_ldap.c
<IfModule mod_ldap.c>
    AuthOrder mod_ldap.c
    LDAPLog /var/log/proftpd/ldap.log
    LDAPAuthBinds on
    LDAPServer myhost
    LDAPUseTLS on
    LDAPBindDN "CN=mybinduser,DC=domain,DC=local" "mybindpw"
    LDAPUsers  "DC=domain,DC=local" "(&(sAMAccountName=%u)(objectclass=user))"
    LDAPAttr uid sAMAccountName
    LDAPAttr gidNumber primaryGroupID
    LDAPDefaultUID 65534
    LDAPDefaultGID 65534
    RequireValidShell off
    LDAPSearchScope subtree
    LDAPGenerateHomedir on
    LDAPGenerateHomedirPrefix /home
    CreateHome on
</IfModule>

Convert KVM raw img to qcow2

With this simple command your can convert raw img to qcow2:

qemu-img convert -f raw -O qcow2 <source>.img <destination>.qcow2

and then edit your virtual domain XML file and replace type="img" with type="qcow2" and update the disk file name.

Done. 🙂

USB drive not recognised (error -71)

CentOS 7 recently had an error when connecting a USB drive. I guess this came after updating to the latest kernel. The errors in dmesg or /var/log/messages were:

[ 4159.607574] usb 1-1: new full speed USB device using uhci_hcd and address 4
[ 2079.875502] usb 1-1: device descriptor read/64, error -71
[ 2080.099379] usb 1-1: device descriptor read/64, error -71
[ 2080.319263] usb 1-1: new full speed USB device using uhci_hcd and address 5
[ 2080.443858] usb 1-1: device descriptor read/64, error -71
[ 4161.322029] usb 1-1: device descriptor read/64, error -71
[ 4161.537896] usb 1-1: new full speed USB device using uhci_hcd and address 6
[ 4161.945615] usb 1-1: device not accepting address 6, error -71
[ 4162.057577] usb 1-1: new full speed USB device using uhci_hcd and address 7
[ 4162.465330] usb 1-1: device not accepting address 7, error -71

After some googleing i found a fix for that:

# vim /etc/modprobe.d/options.conf

and add following line to it:

options usbcore use_both_schemes=y

more information about what this line does can be found here.