顯示具有 Solaris 11 標籤的文章。 顯示所有文章
顯示具有 Solaris 11 標籤的文章。 顯示所有文章

2014年12月18日 星期四

Solaris 11 DNS Client 設定

Solaris 11  DNS Client 設定

檢查現有的DNS Client 設定
root@s11:~# svccfg -s network/dns/client listprop config
config                      application
config/value_authorization astring     solaris.smf.value.name-service.dns.client

更新 DNS Client 設定
root@s11:~# svccfg -s network/dns/client setprop config/nameserver = net_address: "(168.95.1.1  8.8.8.8)"

root@s11:~# svccfg -s network/dns/client setprop config/domain = astring: test.com.tw


root@s11:~# svccfg -s network/dns/client setprop config/search = astring: '("test.com.tw" "test1.com.tw")'


設定名稱解析順序
root@s11:~# svccfg -s name-service/switch setprop config/ipnodes = astring: '("files dns")'
root@s11:~# svccfg -s name-service/switch setprop config/host = astring: '("files dns")'




檢視DNS Client變更的設定
root@s11:~# svccfg -s network/dns/client listprop config
config                      application
config/value_authorization astring     solaris.smf.value.name-service.dns.client
config/nameserver          net_address 168.95.1.1 8.8.8.8
config/domain              astring     test.com.tw
config/search              astring     "test.com.tw" "test1.com.tw"
root@s11:~#


檢視nsswitch變更的設定
root@s11:~# svccfg -s name-service/switch listprop config
config                      application
config/default             astring     files
config/value_authorization astring     solaris.smf.value.name-service.switch
config/printer             astring     "user files"
config/ipnodes             astring     "files dns"
config/host                astring     "files dns"

匯出DNS Client 設定組態
root@s11:~# svcadm enable dns/client

root@s11:~# more /etc/resolv.conf                                    (此時檢視/etc/resolv.conf並不存在)
/etc/resolv.conf: No such file or directory

root@s11:~#  nscfg export svc:/network/dns/client:default
root@s11:~# more /etc/resolv.conf                                     (此時檢視/etc/resolv.conf已建立)

#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
#   DO NOT EDIT THIS FILE.  EDITS WILL BE LOST.
# See resolv.conf(4) for details.

domain  test.com.tw
search  test.com.tw test1.com.tw
nameserver      168.95.1.1
nameserver      8.8.8.8
root@s11:~#


root@s11:~# svcadm refresh name-service/switch
root@s11:~# cat /etc/nsswitch.conf

#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
#   DO NOT EDIT THIS FILE.  EDITS WILL BE LOST.
# See nsswitch.conf(4) for details.

passwd: files
group:  files
hosts:  files dns
ipnodes:        files dns
networks:       files
protocols:      files




root@s11:~# nscfg import -f name-service/switch:default
root@s11:~# nscfg import -f dns/client:defaul






===================分隔線 =========================================
此設定reboot 設定會清除

I. DNS client setup

1. 設定network/dns/client  SMF 服務 

# svccfg -s network/dns/client
svc:/network/dns/client> setprop config/search = astring: ("test.com.tw""test1.com.tw")
svc:/network/dns/client> setprop config/nameserver = net_address: (168.95.1.1 8.8.8.8)
svc:/network/dns/client> exit

2. 開啟 DNS client 服務 (第一次使用需要設定)

#svcadm enable -r dns/client

3.重啟/更新 DNS client 服務 (當設定完成或是有任何更新時)

#svcadm refresh dns/client

#svcadm restart dns/client

4. 檢查設定完成後/etc/resolv.conf 是否有更新(出現紅字部份)

# more /etc/resolv.conf
#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
#   DO NOT EDIT THIS FILE.  EDITS WILL BE LOST.
# See resolv.conf(4) for details.

search           cht.com.tw cht1.com.tw
nameserver      xx.xx.xx.xx
nameserver      yy.yy.yy.yy
---

II.  設定Name service switch 使用 DNS

1. 設定 system/name-service/switch SMF 服務

# svccfg -s system/name-service/switch
svc:/system/name-service/switch> setprop config/host = astring: "files dns"
svc:/system/name-service/switch>end

2.  .重啟/更新 name-service/switch 服務

#svcadm refresh name-service/switch

#svcadm restart  name-service/switch

3. 檢查設定完成後/etc/nsswitch.conf檔,出現紅字部份的更新)

# more /etc/nsswitch.conf

#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
#   DO NOT EDIT THIS FILE.  EDITS WILL BE LOST.
# See nsswitch.conf(4) for details.

passwd: files
group:  files
hosts:  files dns
ipnodes:        files dns

.

最後nslookup試試看DNS是否解析





2014年12月3日 星期三

Solaris 11 SSH 登入慢

Solaris 11 SSH login slow


# vi /etc/ssh/sshd_config
加入下面三行

LookupClientHostnames no
VerifyReverseMapping no
GSSAPIAuthentication no

# svcadm restart ssh

2014年6月12日 星期四

Solaris 11 如何設定較強的密碼限制

編輯/etc/default/passwd 檔案。

a. 要求使用者每個月都要變更密碼,但更換的頻率間隔不得少於三個禮拜。
## /etc/default/passwd
##
MAXWEEKS=
MINWEEKS=
MAXWEEKS=4
MINWEEKS=3

b. 要求密碼至少要有8 個字元。
#PASSLENGTH=6
PASSLENGTH=8

c. 保留密碼歷程記錄。
#HISTORY=0
HISTORY=10

d. 要求與上個密碼的最小差異。
#MINDIFF=3
MINDIFF=4

e. 要求至少要有一個大寫字母。
#MINUPPER=0
MINUPPER=1

f. 要求至少要有一個數字。
#MINDIGIT=0
MINDIGIT=1

2013年10月30日 星期三

在Solaris 11安裝GUI介面

If the GUI was not installed on Solaris 11 server, follow below steps to enable GUI feature.

1. Log in as root

2. Use pkg to install

# pkg install solaris-desktop

3. Enable GUI service

# svcadm enable gdm

4. Reboot

After system rebooting, the GUI would shown up.