Archive for March, 2011

29
Mar

radius - ldap

   Posted by: admin    in Linúc ếch bợt, Mẹo vặt của hiếu râu

install freeradius

cd /etc/freeradius - etc/raddb

vi radiusd.conf

ldap {

server = “demo1″

identity = “myaccount”

password = “mypassword”

basedn = “OU=Users,OU=Production,DC=demo,DC=com,DC=vn”

filter = “(&(sAMAccountName=%{Stripped-User-Name:-%{User-Name}})(memberOf=OU=Groups,OU=Production,DC=demo,DC=com,DC=vn))”

#password_attribute = userPassword

# set this to ‘yes’ to use TLS encrypted connections

# to the LDAP database by using the StartTLS extended

# operation.

# The StartTLS operation is supposed to be used with normal

# ldap connections instead of using ldaps (port 689) connections

start_tls = no

# tls_cacertfile        = /path/to/cacert.pem

# tls_cacertdir         = /path/to/ca/dir/

# tls_certfile          = /path/to/radius.crt

# tls_keyfile           = /path/to/radius.key

# tls_randfile          = /path/to/rnd

# tls_require_cert      = “demand”

# default_profile = “cn=radprofile,ou=dialup,o=My Org,c=UA”

# profile_attribute = “radiusProfileDn”

#access_attr = “dialupAccess” <<——– comment this line

# Mapping of RADIUS dictionary attributes to LDAP

Uncomment ldap in authorize and authenticate sessions
vi clients.conf
client 10.100.0.0/24 {
secret          = mypassword
shortname       = hcm-network-vl100
}
vi users
DEFAULT Auth-Type = LDAP
Fall-Through = 1
radtest user pass 127.0.0.1 0 testing123
29
Mar

httpd - ldap

   Posted by: admin    in Linúc ếch bợt, Mẹo vặt của hiếu râu

LoadModule ldap_module modules/mod_ldap.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so

AuthType Basic
AuthBasicProvider ldap
AuthName “DEMO”
AuthLDAPURL “ldap://demo1.demo.com.vn:3268 demo2:3268/DC=demo,DC=com,DC=vn?samAccountName?sub?(objectCategory=person)”

AuthLDAPBindDN demo\myaccount

AuthLDAPBindPassword mypassword

Require ldap-group OU=Groups,OU=Production,DC=demo,DC=com,DC=vn

23
Mar

USB 3G modem 4linux

   Posted by: admin    in Mẹo vặt của hiếu râu

#lsusb

vendor=0×0471 product=0×1237

#rmmod usb-storage

#modprobe usbserial vendor=0×0471 product=0×1237

—————————————–

#file wvdial.conf
#internet Dialer version 1.56
#created by Cyblade
#Written for the E220 usb modem
[Dialer Defaults]
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = Analog Modem
ISDN = 0
Phone = *99***1#
Modem = /dev/ttyUSB0
username = username
Password = password
Dial Command = ATDT
Baud =466600
Init4 = AT+CGDCONT=1,”IP”,”e-connect”

—————————-

/etc/modprobe.d/modprobe.conf

options usbserial vendor=0×0471 product=0×1237