一、要先檢查是否有安裝 ncsa_auth 和 htpasswd 這兩支程式
# rpm -ql squid | grep ncsa
/usr/lib64/squid/ncsa_auth
/usr/share/man/man8/ncsa_auth.8.gz
# rpm -ql httpd | grep htpasswd
/usr/bin/htpasswd
/usr/share/man/man1/htpasswd.1.gz
如果檢查沒有 htpasswd 這支程式要先安裝
# yum install httpd
二、要修改 squid.conf 設定檔
# vi /etc/squid/squid.conf
auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/passwd //驗證帳密程式存放位置auth_param basic realm (Welcome to Squid Sever) //使用者在輸入帳密的地方所顯示的說明文字
auth_param basic children 100 //同時接受認證的連線數
auth_param basic credentialsttl 2 hours //使用者連線時的連續時間
acl squid_user proxy_auth REQUIRE //開啟帳密認證功能
http_access allow squid_user //認證成功後允許上網要求,要設在第一個位置
三、新增使用者及密碼
建立一位使用者「student」為要新增的帳號
# htpasswd -c /usr/etc/passwd student //第一次 htpasswd 建立帳號及密碼時要記得加參數-c
New password:
Re-type new password:
Adding password for user student
四、重新啟動Squid伺服器 /etc/init.d/squid restart
2013年10月14日 星期一
2013年10月1日 星期二
艾富系統-會計系統主機轉移至Windows 2008伺服器
最近客戶那裡的會計系統伺服器已使用很久,整個系統要轉移,原本已經是個「 大工程」可是後發現,其實只要步驟正確就還好,只是轉移的過程不小心把一個DBF檔案弄到不小心損壞了,最後還是有救回來。
(1) 請會計室相關人員退出ACCSEN網路磁碟及網頁請購系統網路停用,防止資料繼續寫下資料庫裡。
(2) 從原先會計系統伺服器上將電腦名稱、IP、使用者名稱,抄下來。
(3) 從D磁碟裡的ACCSEN資料夾Copy下來。
(4) 在新的伺服器上建立抄下來的使用者資料及ACCWEB這個User,另外建立一組aufiaccount的群組資料,將會使用會計系統主機的使用者加入aufiaccount群組內(含ACCWEB使用者)。
(5) 在新的伺服器將ACCSEN資料夾Copy過來,並將aufiaccount群組加入ACCSEN資料夾的權限及安全性(不然執行備份時會出現Read-only的錯誤訊息)。
(1) 請會計室相關人員退出ACCSEN網路磁碟及網頁請購系統網路停用,防止資料繼續寫下資料庫裡。
(2) 從原先會計系統伺服器上將電腦名稱、IP、使用者名稱,抄下來。
(3) 從D磁碟裡的ACCSEN資料夾Copy下來。
(4) 在新的伺服器上建立抄下來的使用者資料及ACCWEB這個User,另外建立一組aufiaccount的群組資料,將會使用會計系統主機的使用者加入aufiaccount群組內(含ACCWEB使用者)。
(5) 在新的伺服器將ACCSEN資料夾Copy過來,並將aufiaccount群組加入ACCSEN資料夾的權限及安全性(不然執行備份時會出現Read-only的錯誤訊息)。
2013年9月13日 星期五
Windows DHCP Option138 設定方式
(1) Add option 138 into DHCP
server. Right click on the DHCP domain then click the “Set Predefined Options”.
(2) Add the Option 138 value. As
bellowed. Check array as multiple IPs
(3)Sign the Option 138 to the specific IP pool
(4)Fill the Option 138 value to pool
教育部TANet無線漫遊設定【AD方式】
CentOS 6.8版本下載點
CentOS 7 版本下載點
在 CentOS 的安裝上,我是選擇陽春版的方式處理,這樣子等一下會安裝的套件比較多,但是也可以了解是那些套件要安裝,以後查修比較簡單。
安裝前先升級 yum 套件
[root@openvpn]# yum -y update
步驟一:安裝 OPENVPN軟體
================================
[root@openvpn]# yum install -y epel-release
[root@openvpn]# yum install -y openvpn
步驟二:將漫遊中心提供的 key「clt_number_name.tar」上傳放置 /etc/openvpn
================================
CentOS 6.10裝法
[root@openvpn]# cd /etc/openvpn
[root@openvpn]# tar -zxf clt_number_shortname.tar
[root@openvpn]# service openvpn restart
[root@openvpn]# chkconfig openvpn on
CentOS 7.0裝法
[root@openvpn]# cd /etc/openvpn
[root@openvpn]# tar -zxf clt_number_shortname.tar
[root@openvpn]# cp client.conf server.conf
[root@openvpn]# systemctl restart openvpn@server
[root@openvpn]# systemctl enable openvpn@server
看 tun0 VPN通道是否有啟動,如 tun0 有產生10.1.X.X代表VPN連線成功
步驟三:安裝 freeradius 軟體套件
================================
[root@freeradius]# yum install -y freeradius freeradius-utils
[root@freeradius]# cd /etc/raddb
[root@freeradius]# vi clients.conf
//設定學校的網域名稱
修改 selinux 關閉
# vim /etc/sysconfig/selinux
SELINUX=disabled #關閉selinux功能
root@tanetroaming]# yum -y install samba.x86_64
root@tanetroaming]# yum -y install samba-client samba-winbind*
root@tanetroaming]# cd /etc/sambas
root@tanetroaming]# mv smb.conf smb.cmb.conf.def
root@tanetroaming]# cp smb.conf.example smb.conf
root@tanetroaming]# yum install krb5-server.x86_64 krb5-workstation -y
root@tanetroaming]# vim /etc/krb5.conf
=================================
includedir /etc/krb5.conf.d/
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
default_realm = AAA.BBB.EDU.TW #新增網域名稱(大寫)
default_ccache_name = KEYRING:persistent:%{uid}
[realms]
AAA.BBB.EDU.TW= { #新增網域名稱(大寫)
kdc =192.168.1.10:88
admin_server =192.168.1.10:749
default_domain = aaa.bbb.edu.tw
}
[domain_realm] #新增網域名稱,注意大小寫
.aaa.bbb.edu.tw = AAA.BBB.EDU.TW
aaa.bbb.edu.tw = AAA.BBB.EDU.TW
[kdc] #增加kdc認證路徑
profile = /var/kerberos/krb5kdc/kdc.conf
================================
[root@tanetroaming]# vim /var/kerberos/krb5kdc/kdc.conf
[root@tanetroaming]# service smb restart #CentOS 6版指令
[root@tanetroaming]# systemctl restart smb.service #CentOS 7版指令
[root@tanetroaming]# chkconfig smb on #重啟 samba 服服務開機自動啟動服務
測試 samba 與 kdc 溝通
[root@tanetroaming]#kinit administrator@AAA.BBB.EDU.TW
(一定要大寫,不然就出現下列的錯誤訊息)
kinit: KDC reply did not match expectations while getting initial credentials
kinit: Clock skew too great while getting initial credentials
這個錯誤訊息是系統時間差太多了,所以要執行NTP功能
可以參考一下這個Fibe-mini 's BLOG網站NTP的做法
步驟七:將centos加入windows AD網域
====================================
[root@tanetroaming]#net rpc join -U administrator #輸入管理者帳號
Enter admin's password:****** #輸入管理者密碼
Using short domain name --WINAD
Joined 'CENTOS' to realm 'aaa.bbb.edu.tw' #出現這個代表加入成功!!
步驟八:安裝 winbind
===============================
root@tanetroaming]#yum install samba-winbind.x86_64
root@tanetroaming]#vi /etc/nsswitch.conf
# Example:
#passwd: db files nisplus nis
#shadow: db files nisplus nis
#group: db files nisplus nis
passwd: files winbind #新增winbind
shadow: files winbind #新增winbind
group: files winbind #新增winbind
重啟winbind服務開機自動啟動服務
[root@tanetroaming]# systemctl restart winbind.service #CentOS7 指令
[root@tanetroaming]# service winbind start #CentOS6 指令
[root@tanetroaming]# chkconfig winbind on
測試ntlm_auth連接AD帳號
[root@tanetroaming]#ntlm_auth --request-nt-key --domain=DOMAIN(大寫) --username=AD帳號 --password=AD帳號密碼
root@tanetroaming]#ntlm_auth --request-nt-key --domain=AAA.BBB.EDU.TW --username=test1 --password=XXXXXX
NT_STATUS_OK: Success (0x0)#出現這個代表成功了!!!
步驟九:修改 freeradius 修改ntlm_auth模組(802.1X)
=====================================
[root@tanetroaming]# vim /etc/raddb/modules/ntlm_auth
exec ntlm_auth {
wait = yes
#program = "/path/to/ntlm_auth --request-nt-key --domain=MYDOMAIN --username=%{mschap:User-Name} --password=%{User-Password}" #將這一行註銷起來
program = "/usr/bin/ntlm_auth --request-nt-key --domain=aaa.bbb.edu.tw --username=%{%{Stripped-User-Name}:-%{%{User-Name}:-None}} --password=%{User-Password}"
#修改執行路徑和NULL認證方式
}
[root@tanetroaming]# vi /etc/raddb/sites-available/default
=====================================
authorize {
。。。略。。。
# Read the 'users' file
files
if (!control:Auth-Type && User-Password) { #新增ntlm_auth驗證
update control {
Auth-Type := ntlm_auth
}
}
#
# Look in an SQL database. The schema of the database
# is meant to mirror the "users" file.
#
# See "Authorization Queries" in sql.conf
# sql
。。。略。。。
}
authenticate {
。。。略。。。
Auth-Type MS-CHAP {
mschap
}
Auth-Type ntlm_auth { #新增ntlm_auth驗證
ntlm_auth
}
==========================================
[root@freeradius ]# service radiusd restart #重啟 freeradius服務
測試freeradius+AD認證
[root@tanetroaming]# radtest AD帳號 AD帳號密碼 127.0.0.1 0 testing123
Sending Access-Request Id 152 from 0.0.0.0:50068 to 127.0.0.1:1812
User-Name = 'AD帳號'
User-Password = 'AD帳號密碼'
NAS-IP-Address = 192.168.1.20
NAS-Port = 0
Message-Authenticator = 0x00
Received Access-Accept Id 152 from 127.0.0.1:1812 to 127.0.0.1:50068 length 40
Reply-Message = 'AD CONECTSUCCESS' #代表認證成功
======= 以下2013年舊版資料======
[root@RADIUS~]# yum install freeradius freeradius-utils
[root@RADIUS~]# vi /etc/raddb/proxy.conf
[root@RADIUS~]#
[root@RADIUS~]#
[root@RADIUS~]#
Radius Server較重要的系統設定檔
radiusd.conf #FreeRADIUS 主要系統設定檔
eap.conf #EAP 認證相關設定檔
clients.conf #認證客戶端設定檔
proxy.conf #認證轉送設定檔
users #本地帳號及處理方式設定檔
snmp.conf #SNMP 相關設定檔
在etc/raddb/裡的proxy.conf設定
# vi proxy.conf
==============================================
//當遇到帳號是別的學校帳號時的預設動作為以本機進行認證動作
realm NULL {
authhost = LOCAL
accthost = LOCAL
secret = niucltcc //漫遊中心給的Radius Key (金鑰)
}
//設定學校的網域名額
realm xxxxx.tc.edu.tw {
authhost = 210.60.70.80:1812 //設定Radius Server認證(auth)位址
accthost = 210.60.70.80:1813 //設定Radius Server計費(accounting)位址
secret = xxxx //Radius Key (金鑰)
# nostrip
}
//當遇到帳號是有別的學校帳號時的預設動作為送至漫遊中心進行 Proxy 動作
realm DEFAULT {
authhost = 10.1.0.7:1812 //設定Radius Server認證(auth)位址
accthost = 10.1.0.7:1813 //設定Radius Server計費(accounting)位址
secret = niucltcc //漫遊中心給的Radius Key (金鑰)
nostrip
}
===========================================
CentOS 7 版本下載點
在 CentOS 的安裝上,我是選擇陽春版的方式處理,這樣子等一下會安裝的套件比較多,但是也可以了解是那些套件要安裝,以後查修比較簡單。
安裝前先升級 yum 套件
[root@openvpn]# yum -y update
步驟一:安裝 OPENVPN軟體
================================
[root@openvpn]# yum install -y epel-release
[root@openvpn]# yum install -y openvpn
================================
CentOS 6.10裝法
[root@openvpn]# cd /etc/openvpn
[root@openvpn]# tar -zxf clt_number_shortname.tar
[root@openvpn]# service openvpn restart
[root@openvpn]# chkconfig openvpn on
CentOS 7.0裝法
[root@openvpn]# cd /etc/openvpn
[root@openvpn]# tar -zxf clt_number_shortname.tar
[root@openvpn]# cp client.conf server.conf
[root@openvpn]# systemctl restart openvpn@server
[root@openvpn]# systemctl enable openvpn@server
看 tun0 VPN通道是否有啟動,如 tun0 有產生10.1.X.X代表VPN連線成功
步驟三:安裝 freeradius 軟體套件
================================
[root@freeradius]# yum install -y freeradius freeradius-utils
[root@freeradius]# cd /etc/raddb
[root@freeradius]# vi clients.conf
================================
client 10.1.77.7 {
client 10.1.77.7 {
secret = spiradawn
shortname = roamingcenter
}
shortname = roamingcenter
}
client 192.168.10.199 {
secret = radius-key
shortname = controller
}
client 10.1.77.11 {
secret = spiradawn
shortname = roamingcenter-monitor
shortname = roamingcenter-monitor
}
===================================
修改/etc/raddb的proxy.conf檔案
[root@freeradius]# vi proxy.conf
===================================
<-->-->
realm NULL {
authhost = LOCAL
accthost = LOCAL
secret = niucltcc
}
//設定學校的網域名稱
realm ntusd.ttc.edu.tw {
authhost = LOCAL //設定Radius Server認證(auth)位址
accthost = LOCAL //設定Radius Server計費(accounting)位址
}
realm DEFAULT {
authhost = 10.1.77.7:1812
accthost = 10.1.77.7:1813
secret = spiradawn //漫遊中心給的Radius Key (金鑰)
nostrip
}
authhost = 10.1.77.7:1812
accthost = 10.1.77.7:1813
secret = spiradawn //漫遊中心給的Radius Key (金鑰)
nostrip
}
==============================
啟動 Freeradius 服務
CentOS 6.10的方式
CentOS 6.10的方式
[root@freeradius ]#service radiusd restart
[root@freeradius ]#chkconfig radiusd on -->開機啟動
CentOS 7的方式
[root@freeradius ]# systemctl restart radiusd
[root@freeradius ]# systemctl enable radiusd -->開機啟動
[root@freeradius]# radtest testuser@niu testpass 127.0.0.1 0 testing123
radtest 帳號 密碼 測試伺服器 通訊埠 Secret
Sending Access-Request of id 234 to 10.1.0.7 port 1812
User-Name = "testuser@niu"
User-Password = "testpass"
NAS-IP-Address = 127.0.0.1
NAS-Port = 0
rad_recv: Access-Accept packet from host 10.1.0.7 port 1812, id=234, length=20
以上測試freeradius驗證是否正常
步驟四:修正 hosts 檔案
================================
================================
[root@tanetroaming]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomainlocalhost6 localhost6.localdomain6
192.168.1.10 winad.aaa.bbb.edu.tw aaa.bbb.edu.tw winad
#AD→IP FQDN 網域名稱 電腦名稱
192.168.1.20 centos.aaa.bbb.edu.tw centos
#radius→IP FQDN網域名稱 電腦名稱
================================::1 localhost localhost.localdomainlocalhost6 localhost6.localdomain6
192.168.1.10 winad.aaa.bbb.edu.tw aaa.bbb.edu.tw winad
#AD→IP FQDN 網域名稱 電腦名稱
192.168.1.20 centos.aaa.bbb.edu.tw centos
#radius→IP FQDN網域名稱 電腦名稱
修改 selinux 關閉
# vim /etc/sysconfig/selinux
SELINUX=disabled #關閉selinux功能
關閉防火牆功能 --> CentOS 6 指令
# /etc/init.d/iptables save 存檔
# /etc/init.d/iptables stop 停止
開機時停用防火牆
# chkconfig iptables off
關閉 Firewalld 防火牆指令: --> CentOS 7 指令
# systemctl stop firewalld.service
設定下次開機不會啟動 Firewalld 防火牆
# systemctl disable firewalld.service
# systemctl disable firewalld.service
================================
步驟五:安裝samba
================================
安裝 Samba 伺服器root@tanetroaming]# yum -y install samba.x86_64
root@tanetroaming]# yum -y install samba-client samba-winbind*
root@tanetroaming]# cd /etc/sambas
root@tanetroaming]# mv smb.conf smb.cmb.conf.def
root@tanetroaming]# cp smb.conf.example smb.conf
步驟六:安裝 Kerberos
===============================root@tanetroaming]# yum install krb5-server.x86_64 krb5-workstation -y
root@tanetroaming]# vim /etc/krb5.conf
=================================
includedir /etc/krb5.conf.d/
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
default_realm = AAA.BBB.EDU.TW #新增網域名稱(大寫)
default_ccache_name = KEYRING:persistent:%{uid}
[realms]
AAA.BBB.EDU.TW= { #新增網域名稱(大寫)
kdc =192.168.1.10:88
admin_server =192.168.1.10:749
default_domain = aaa.bbb.edu.tw
}
[domain_realm] #新增網域名稱,注意大小寫
.aaa.bbb.edu.tw = AAA.BBB.EDU.TW
aaa.bbb.edu.tw = AAA.BBB.EDU.TW
[kdc] #增加kdc認證路徑
profile = /var/kerberos/krb5kdc/kdc.conf
================================
[root@tanetroaming]# vim /var/kerberos/krb5kdc/kdc.conf
[root@tanetroaming]# service smb restart #CentOS 6版指令
[root@tanetroaming]# systemctl restart smb.service #CentOS 7版指令
[root@tanetroaming]# chkconfig smb on #重啟 samba 服服務開機自動啟動服務
測試 samba 與 kdc 溝通
[root@tanetroaming]#kinit administrator@AAA.BBB.EDU.TW
(一定要大寫,不然就出現下列的錯誤訊息)
kinit: KDC reply did not match expectations while getting initial credentials
kinit: Clock skew too great while getting initial credentials
這個錯誤訊息是系統時間差太多了,所以要執行NTP功能
可以參考一下這個Fibe-mini 's BLOG網站NTP的做法
步驟七:將centos加入windows AD網域
====================================
[root@tanetroaming]#net rpc join -U administrator #輸入管理者帳號
Enter admin's password:****** #輸入管理者密碼
Using short domain name --WINAD
Joined 'CENTOS' to realm 'aaa.bbb.edu.tw' #出現這個代表加入成功!!
步驟八:安裝 winbind
root@tanetroaming]#yum install samba-winbind.x86_64
root@tanetroaming]#vi /etc/nsswitch.conf
# Example:
#passwd: db files nisplus nis
#shadow: db files nisplus nis
#group: db files nisplus nis
passwd: files winbind #新增winbind
shadow: files winbind #新增winbind
group: files winbind #新增winbind
重啟winbind服務開機自動啟動服務
[root@tanetroaming]# systemctl restart winbind.service #CentOS7 指令
[root@tanetroaming]# service winbind start #CentOS6 指令
[root@tanetroaming]# chkconfig winbind on
測試ntlm_auth連接AD帳號
[root@tanetroaming]#ntlm_auth --request-nt-key --domain=DOMAIN(大寫) --username=AD帳號 --password=AD帳號密碼
root@tanetroaming]#ntlm_auth --request-nt-key --domain=AAA.BBB.EDU.TW --username=test1 --password=XXXXXX
NT_STATUS_OK: Success (0x0)#出現這個代表成功了!!!
步驟九:修改 freeradius 修改ntlm_auth模組(802.1X)
=====================================
[root@tanetroaming]# vim /etc/raddb/modules/ntlm_auth
exec ntlm_auth {
wait = yes
#program = "/path/to/ntlm_auth --request-nt-key --domain=MYDOMAIN --username=%{mschap:User-Name} --password=%{User-Password}" #將這一行註銷起來
program = "/usr/bin/ntlm_auth --request-nt-key --domain=aaa.bbb.edu.tw --username=%{%{Stripped-User-Name}:-%{%{User-Name}:-None}} --password=%{User-Password}"
#修改執行路徑和NULL認證方式
}
[root@tanetroaming]# vi /etc/raddb/sites-available/default
=====================================
authorize {
。。。略。。。
# Read the 'users' file
files
if (!control:Auth-Type && User-Password) { #新增ntlm_auth驗證
update control {
Auth-Type := ntlm_auth
}
}
#
# Look in an SQL database. The schema of the database
# is meant to mirror the "users" file.
#
# See "Authorization Queries" in sql.conf
# sql
。。。略。。。
}
。。。略。。。
Auth-Type MS-CHAP {
mschap
}
Auth-Type ntlm_auth { #新增ntlm_auth驗證
ntlm_auth
}
==========================================
[root@freeradius ]# service radiusd restart #重啟 freeradius服務
測試freeradius+AD認證
[root@tanetroaming]# radtest AD帳號 AD帳號密碼 127.0.0.1 0 testing123
Sending Access-Request Id 152 from 0.0.0.0:50068 to 127.0.0.1:1812
User-Name = 'AD帳號'
User-Password = 'AD帳號密碼'
NAS-IP-Address = 192.168.1.20
NAS-Port = 0
Message-Authenticator = 0x00
Received Access-Accept Id 152 from 127.0.0.1:1812 to 127.0.0.1:50068 length 40
Reply-Message = 'AD CONECTSUCCESS' #代表認證成功
======= 以下2013年舊版資料======
[root@RADIUS~]# yum install freeradius freeradius-utils
[root@RADIUS~]# vi /etc/raddb/proxy.conf
[root@RADIUS~]#
[root@RADIUS~]#
[root@RADIUS~]#
Radius Server較重要的系統設定檔
radiusd.conf #FreeRADIUS 主要系統設定檔
eap.conf #EAP 認證相關設定檔
clients.conf #認證客戶端設定檔
proxy.conf #認證轉送設定檔
users #本地帳號及處理方式設定檔
snmp.conf #SNMP 相關設定檔
在etc/raddb/裡的proxy.conf設定
# vi proxy.conf
==============================================
//當遇到帳號是別的學校帳號時的預設動作為以本機進行認證動作
realm NULL {
authhost = LOCAL
accthost = LOCAL
secret = niucltcc //漫遊中心給的Radius Key (金鑰)
}
//設定學校的網域名額
realm xxxxx.tc.edu.tw {
authhost = 210.60.70.80:1812 //設定Radius Server認證(auth)位址
accthost = 210.60.70.80:1813 //設定Radius Server計費(accounting)位址
secret = xxxx //Radius Key (金鑰)
# nostrip
}
//當遇到帳號是有別的學校帳號時的預設動作為送至漫遊中心進行 Proxy 動作
realm DEFAULT {
authhost = 10.1.0.7:1812 //設定Radius Server認證(auth)位址
accthost = 10.1.0.7:1813 //設定Radius Server計費(accounting)位址
secret = niucltcc //漫遊中心給的Radius Key (金鑰)
nostrip
}
===========================================
# vi clients.conf //設定認證的網路IP
===========================================
//漫遊中心的Radius Proxy IP
client 10.1.0.7 {
secret = niucltcc //漫遊中心給的Radius Key (金鑰)
shortname = niu //漫遊中心的伺服器註解(可自定)
}
//漫遊中心的Radius Proxy IP
client 10.1.0.11 {
secret = niucltcc //漫遊中心給的Radius Key (金鑰)
shortname = niu_monitor //漫遊中心的伺服器註解(可自定)
}
//使用單位自己的Radius Server IP
client 100.170.125.80 {
secret = xxxxx //使用單位自己的Radius Key (金鑰)
shortname = ldap-server //使用單位自己的LDAP伺服器註解(可自定)
}
//使用單位自己的無線認證設備IP
client 192.168.10.200 {
secret = xxxxx //設定在無線認證設備的Radius Key (金鑰)
shortname = NXC0000 //使用單位自己的認證伺服器註解(可自定)
}
<測試外面學校帳號是否可漫遊至認證中心>
=====================================
# radtest tcccvs@test.niu.edu.tw tcccvs1qazz 10.1.0.7 0 niucltcc
radtest 帳號、密碼、測試伺服器、測試伺服器之通訊埠 Secret
【若為下列訊息代表可以由外面的帳號可漫遊至學校自己的Radius Proxy】
Sending Access-Request of id 104 to 10.1.0.7 port 1812
User-Name = "tchcvs@test.niu.edu.tw"
User-Password = "tchcvs1qazz"
NAS-IP-Address = 210.60.70.80
NAS-Port = 0
Message-Authenticator = 0x00000000000000000000000000000000
rad_recv: Access-Accept packet from host 10.1.0.7 port 1812, id=104, length=20
<測試學校本身帳號是否可漫遊至認證中心>
# radtest user111@tccch.tc.edu.tw tcc1234 10.1.0.7 0 niucltcc
radtest 帳號、密碼、測試伺服器、測試伺服器之通訊埠 Secret
【若為下列訊息代表可以由學校自己的Radius Proxy漫遊至認證中心】
Sending Access-Request of id 100 to 10.1.0.7 port 1812
User-Name = "xxx@xxxx.tc.edu.tw"
User-Password = "xxxxxxxx"
NAS-IP-Address = 100.170.125.80
NAS-Port = 0
Message-Authenticator = 0x00000000000000000000000000000000
rad_recv: Access-Accept packet from host 10.1.0.7 port 1812, id=100, length=20
===========================================================
參考資料如下
2013年9月3日 星期二
FreeBSD 安裝 SmbFTPD
【方式一】
# cd /usr/ports/ftp/smbftpd
# make install clean
【方式二】
# cd /usr/ports/ftp/smbftpd
# make fetch
# cd /tmp
# cp /usr/ports/distfiles/smbftpd-0.96.tar.gz .
# tar zxvf smbftpd-0.96.tar.gz
# cd smbftpd-0.96
# ./configure
# make
# make certs ( 如果需要 SSL 加密的話,可以在此製作憑證)
# make install
接下來切換到 /usr/local/etc/smbftpd/ 裡面,來設定一下 smbftpd.conf 就可以讓它 work 了,詳細的設定可請參考 twbsd.org,再也沒有比這還詳細的說明 XD
Server 運作的模式選用 standalone 方式,只要編輯 /etc/rc.conf,並加入下列二行,以在開機時啟動 SmbFTPD
smbftpd_enable="Yes"
smbftpd_flags="-D"
若要啟動|關閉的話,就用這行指令
# /usr/local/etc/rc.d/smbftpd.sh start or stop
# cd /usr/ports/ftp/smbftpd
# make install clean
【方式二】
# cd /usr/ports/ftp/smbftpd
# make fetch
# cd /tmp
# cp /usr/ports/distfiles/smbftpd-0.96.tar.gz .
# tar zxvf smbftpd-0.96.tar.gz
# cd smbftpd-0.96
# ./configure
# make
# make certs ( 如果需要 SSL 加密的話,可以在此製作憑證)
# make install
接下來切換到 /usr/local/etc/smbftpd/ 裡面,來設定一下 smbftpd.conf 就可以讓它 work 了,詳細的設定可請參考 twbsd.org,再也沒有比這還詳細的說明 XD
Server 運作的模式選用 standalone 方式,只要編輯 /etc/rc.conf,並加入下列二行,以在開機時啟動 SmbFTPD
smbftpd_enable="Yes"
smbftpd_flags="-D"
若要啟動|關閉的話,就用這行指令
# /usr/local/etc/rc.d/smbftpd.sh start or stop
加入 AD 時發生「找不到網路路徑」解決辦法
Client 的部份要注意下列事項
1. 確認 Client 和 AD Server 中間的網路是通的
2. Client 的 DNS 請設定指向 AD
3. 若 Client 是從 GHOST 而來的,請先做完 NewSID 的動作
4. 確認 Client 的服務裡面的「TCP/IP NetBIOS Helper」是啟用的狀態
技術文件 有為青年生活札記
1. 確認 Client 和 AD Server 中間的網路是通的
2. Client 的 DNS 請設定指向 AD
3. 若 Client 是從 GHOST 而來的,請先做完 NewSID 的動作
4. 確認 Client 的服務裡面的「TCP/IP NetBIOS Helper」是啟用的狀態
技術文件 有為青年生活札記
2013年8月27日 星期二
FreeBSD Samba 無法啟動問題
有一天早上我的客戶的網管小姐突然打電話給我講,怎麼辦我們公司的Samba Server無法使用,我心裡應該是小問題吧,結果我搞了一天挫屎
在FreeBSD使用測試指令檢查Samba Config 是否有問題
# testparm
發現到問題的一行
Load smb config files from /usr/local/etc/smb.conf
max_open_files: sysctl_max (11095) below minimum Windows limit (16384)
rlimit_max: rlimit_max (11095) below minimum Windows limit (16384)
在FreeBSD使用測試指令檢查Samba Config 是否有問題
# testparm
發現到問題的一行
Load smb config files from /usr/local/etc/smb.conf
max_open_files: sysctl_max (11095) below minimum Windows limit (16384)
rlimit_max: rlimit_max (11095) below minimum Windows limit (16384)
ERROR: pid directory /var/run/samba does not exist
Processing section "[printers]"
WARNING: You have some share names that are longer than 12 characters.
These may not be accessible to some older clients.
(Eg. Windows9x, WindowsMe, and smbclient prior to Samba 3.0.)
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
上網找了一下都是國外的網站解答找到原因
因為 Sever 中的 /var/run/samba 這個目錄不見了
所以只要下個指令就可以了
mkdir /var/run/samba
在重新啟動一下Samba Server 就可以了。
訂閱:
文章 (Atom)











