測試平台: ubuntu server 10.10
# vi /etc/pam.d/proftpd
session required pam_mkhomedir.so umask=0022 skel=/etc/skel
helloworld 發表在 痞客邦 留言(0) 人氣(212)
1st time => portsnap fetch extract
2nd and later => portsnap fetch update
helloworld 發表在 痞客邦 留言(0) 人氣(46)
如果我要計算目錄下面 某個副檔名或是某關鍵字檔名的大小加總的話
可以使用awk 來實現
例如
ls -l /var/log/maillog* | awk '{ SUM += $5 } END { print SUM/1024/1024 }'
計算出來的單位是MB

Sed and Awk: Pocket Reference作者: Robbins, Arnold
原文出版社:Oreilly & Associates Inc
出版日期:2002/06/01
語言:英文
定價:348元
helloworld 發表在 痞客邦 留言(0) 人氣(1,390)
如果不想刪除帳號或是要讓ldap 某個account暫時停用的話
似乎沒有直接的屬性可以使用,想到最單純的方法可能是用ACL來實現了
首先編輯slapd.conf 多加一行include /usr/local/etc/openldap/acl_disabled.conf
vi /usr/local/etc/openldap/slapd.conf
include /usr/local/etc/openldap/acl_disabled.conf
access to *
by * read
access to attrs=userPassword
by self write
by * auth
未來如果有要暫時disable一個帳號的話只需要維護acl_disabled.conf
vi /usr/local/etc/openldap/acl_disabled.conf
access to dn="uid=peter,ou=sales,dc=helloworld,dc=com,dc=xx"
by * none
access to dn="uid=mary,ou=tech,dc=helloworld,dc=com,dc=xx"
by * none
比較麻煩的是..每次編輯完記得重新啟動ldap server才會生效,反正帳號不會常異動啦XDDD
另外就是不適用有replication的環境啊orz
helloworld 發表在 痞客邦 留言(0) 人氣(357)
helloworld 發表在 痞客邦 留言(0) 人氣(6)
cd /etc/openldap/ssl
openssl genrsa -out ldap.test.com.key 1024
openssl req -new -key ldap.test.com.key -out ldap.test.com.csr
openssl x509 -req -days 7200 -in ldap.test.com.csr -signkey ldap.test.com.key -out ldap.test.com.crt
vi /etc/openldap/slapd.conf
TLSCipherSuite HIGH::MEDIUM:LOW
TLSCertificateFile /etc/openldap/ssl/ldap.test.com.crt
TLSCertificateKeyFile /etc/openldap/ssl/ldap.test.com.key
/etc/init.d/ldap restart
cat /etc/services | grep ldap
ldap 389/tcp
ldap 389/udp
ldaps 636/tcp # LDAP over SSL
ldaps 636/udp # LDAP over SSL
檢查一下有沒有LISTEN兩個port
netstat -na | grep LISTEN
tcp 0 0 0.0.0.0:389 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:636 0.0.0.0:* LISTEN
helloworld 發表在 痞客邦 留言(0) 人氣(396)
升級前
telnet 0 22
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.4p1 FreeBSD-20100308
步驟:抓source回來解開
./configure && make && make install
helloworld 發表在 痞客邦 留言(0) 人氣(134)

1.首先建立user
ASA(config)# username cisco password cisco
2.產生key
ASA(config)# crypto key generate rsa modulus (512/768/1024/2048)
3.允許ssh的interface
ASA(config)# ssh a.b.c.d 255.255.255.0 management
4.ssh的timeout時間
ASA(config)# ssh timeout 5
5.如果出現Permission denied, please try again.請注意下面的設定有沒有加上去
ASA(config)# aaa authentication ssh console LOCAL
CCNA Routing and Switching 認證教戰手冊 第二版
作者: Todd Lammle
譯者: 林慶德, 陳宇芬
出版社:旗標
出版日期:2017/04/28
語言:繁體中文
定價:1180元
helloworld 發表在 痞客邦 留言(0) 人氣(3,383)
如果忘記或是已經遺失 cisco router 的 enable password
可依照下列步驟重設密碼
本測試環境為 cisco router 1700
資料來源 : http://www.cisco.com/en/US/products/hw/routers/ps221/products_password_recovery09186a0080094773.shtml
1. router重開機
2. 在60秒內按下break鍵
3. 在 rommon 1> 的提示符號下輸入 confreg 0x2142
4. 在 rommon 2> 的提示符號下輸入 reset, 這時候 router 會重開機
5. 出現任何選項都按no 或是 ctrl+C 中斷這個對話過程
6. 在router> 的提示符號下輸入 enable
7. 輸入 configure memory 或 copy startup-config running-config 將nvram的資料複製一份到記憶體,切記不要輸入 copy running-config startup-config 或 write ,否則會蓋過你的設定檔
8. show running-config看看你的設定檔
9. 設定密碼, conf t ==> enable secret XXXX
10. hostname(config)#config-register 0x2102
11. end 或 ctrl+z 結束設定狀態
12. 輸入 write memory 或 copy running-config startup-config 儲存設定檔
13. 重開機試試看:p
helloworld 發表在 痞客邦 留言(0) 人氣(2,072)
helloworld 發表在 痞客邦 留言(0) 人氣(239)