2014年10月20日 星期一

Solaris 11 NFS 設定

啟動NFS服務

# svcadm enable network/nfs/server

關閉NFS服務

# svcadm disable network/nfs/server

開啟automounter

# svcadm enable system/filesystem/autofs


檢查伺服器是否啟動NFS 服務

# svcs network/nfs/server


# svcs network/nfs/server
STATE          STIME    FMRI
disabled       18:03:46 svc:/network/nfs/server:default    目前狀態是關閉的


指令列mount 一個NFS
# mount -F nfs -o ro kitty:/export/home /mnt

Server端分享/export/home目錄給client,並僅有ro的權限
# share -F nfs -o ro=client  /export/home 

檢視目錄分享狀態
#cat /etc/dfs/sharetab
/export/home    export_home     nfs     sec=sys,ro=client


在Client端的vfstab加入一行,讓開機時自動mount起來
svcadm enable  network/nfs/client
server:/export/home     -       /mnt    nfs     0       yes      ro




======================================================================
關於Client Mount 沒有R/W權限

In fact, in this case root would be restricted - not by the target directories permissions but due to would be restricted, as share does not have "anon=0" or "root=<access list>" options - therefore the client's root user is "nobody" to the NFS server.

Server:
root@solaris:~# share -F nfs -o anon=0 /zpool/fs1
root@solaris:~# share
zpool_fs1       /zpool/fs1      nfs     anon=0,sec=sys,rw
root@solaris:~#

Client:
root@S11-ai-installed:/# mount -F nfs 192.168.1.222:/zpool/fs1 /a
可以成功寫入的

================= 分隔線 ===================================
限制由特定Client登入

Server
root@solaris:~# share -F nfs -o anon=0:root=192.168.1.110 /zpool/fs1
root@solaris:~# showmount -e
export list for solaris:
/zpool/fs1 (everyone)









啟動 Solaris 10 VNC Server


  • 檢查VNC 服務

# svcs -a | grep -i vnc
disabled       Sep_19   svc:/application/x11/xvnc-inetd:default
  • 啟動VNC 服務
# svcadm enable svc:/application/x11/xvnc-inetd:default


  • 預設VNC服務是不開啟的,修改一些設定
# svcs svc:/application/x11/xvnc-inetd:default
STATE          STIME    FMRI
maintenance     9:27:11 svc:/application/x11/xvnc-inetd:default

  • 在/etc/services 加入一行
vnc-server         5900/tcp          # Xvnc

  • 設定和啟動gnu 顯示管理給 VNC
cat >/etc/X11/gdm/custom.conf <<!
   [xdmcp]
   Enable=true
   [security]
   DisallowTCP=false
   AllowRoot=true
   AllowRemoteRoot=true
   !

  • 重新啟動和驗證 VNC Server
 # svcadm disable svc:/application/x11/xvnc-inetd:default 
 # svcadm enable svc:/application/x11/xvnc-inetd:default
 # svcs svc:/application/x11/xvnc-inetd:default 
  
   STATE STIME FMRI
online 14:46:43 svc:/application/x11/xvnc-inetd:default
  • 完成,使用Client軟體測試

2014年9月9日 星期二

Solaris 11 設定IP由DCHP到固定IP

步驟一:檢查NCP

此時系統使用DHCP所以DefaultFixed為 Disabled












步驟二:設定NCP

# netadm enable -p ncp DefaultFixed





步驟三:檢查連結狀態

# dladm show-phys
 步驟四:建立一個新的interface

# ipadm create-ip net0




步驟五:檢查新建立的interface





設定IP
 # ipadm create-addr –T static –a local=192.168.1.222/24 net0

檢查interface的狀態
# ipadm show-if


# ipadm show-addr








如果要Unplumb 或是 Delete interface
# ipadm delete-ip net0

2014年6月18日 星期三

pkgutil - Installs Solaris packages easily


http://www.opencsw.org/package/pkgutil/
http://pkgutil.net/

安裝pkgutil
pkgadd -d http://get.opencsw.org/now
/opt/csw/bin/pkgutil -U
/opt/csw/bin/pkgutil -a vim
/opt/csw/bin/pkgutil -y -i vim

幾個常用的指令如下:
  • 更新套件清單
    /opt/csw/bin/pkgutil -U
  • 可用套件清單
    /opt/csw/bin/pkgutil -a
  • 安裝套件
    /opt/csw/bin/pkgutil -i [name]
  • 升級套件
    /opt/csw/bin/pkgutil -u [name]
  • 檢查套件是否有新版
    /opt/csw/bin/pkgutil -c
OpenCSW (pronounced open-cashew /ˈkæʃuː/) is an easy to use open source software distribution installable on top of Solaris and Solaris-based systems. OpenCSW is a community project dedicated to working closely with upstream projects to improve portability of open source software.

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.

Allocate a static IP address to the VMware vCenter Server Appliance (VCSA)


it is possible to manually configure a static IP address by using the command line. Here are the steps:
  • Open a console session of the VCSA 
  • Login as: root
  • Default password is: vmware
  • Execute the following command:
/opt/vmware/share/vami/vami_config_net


image