2013年8月16日 星期五

Serail Port Redirection and VNC setting on Linux

Serail Port Redirection and VNC setting on Linux

How to setup serial port redirection on Linux?

    The purpose of this session is to teach you setting up serial port redirection on RHEL 6 and SLES 11. After setup, you can login linux system in text mode through serial port.

BIOS setup

    Enter BIOS setup menu and open console redirect. This setting can redirect POST screen to serial port.

RHEL 6

Please refer below link to setup after RHEL 6 is installed.
Note. Pysical serial port is COM1 (ttyS0) and serial port of SOL is COM2 (ttyS1)

SLES 11

Please refer below link to setup after SLES 11 is installed


How to establish SOL session?

Using opensource ipmitool to activate SOL session
>ipmitool -I lanplus -H [bmc_ip] -U [bmc_username] -P [bmc_pasword] -C 3 sol activate


press ~. to deactivate session


How to enable remote desktop on Linux?

    The purpose of this session is to each you setting up remote desktop on Linux system, after setup, you can connect to this Linux system by using a vnc client.

RHEL 6

1. Install tigervnc-server
# yum install tigervnc-server


2. edit /etc/sysconfig/vncserver
VNCSERVERS=”2:root”
VNCSERVERARGS[2]=”-geometry 1024x768”


3. Open port 5902 on firewall


4. create /root/.vnc/passwd
# vncpasswd


5. Restart the System


6. Use remote vnc client to open remote desktop


SLES 11

Please refer to below link to setup

2013年6月14日 星期五

開啟NetworkManager可自動註冊hostname進公司windows domain

CentOS 6預設安裝桌面時才會安裝Network Manger,只安裝純文字介面預設不會安裝NetworkManager但可在手動安裝。
用Webmin改hostname之後重開機hostname就可ping的到了

2013年6月6日 星期四

httpd 403 Forbidden

1. set Alias in httpd.conf
Alias /download /opt/download

2. add directory in httpd.conf

    AllowOverride All
    AcceptPathInfo On
    Options Indexes SymLinksIfOwnerMatch FollowSymLinks


http://server/download may return 403 cause selinux

3. set selinux setting
# chcon -tR httpd_sys_content_t /opt/download


Reference:
http://www.mikehomme.com/node/16

2013年5月14日 星期二

Linux SUID, SGID, Sticky bit

當SUID (set user id):chmod u+s file
  • 被設定在檔案上時,檔案的執行者會以檔案的擁有者的身分來執行
當SGID (set group id):chmod g+s file 或是 chmod g+s directory
  • 被設定在檔案上時,檔案的執行者會以檔案的擁有群組的身分來執行
  • 當設定在目錄上時,在此目錄下新建的檔案群組會被自動套用此目錄的群組 
Sticky bit:chmod +t directory
  • 當設定在目錄上時,以下的檔案只有該擁有者才能刪除或更名( /tmp )
http://en.wikipedia.org/wiki/Setuid
http://en.wikipedia.org/wiki/Sticky_bit

2013年5月13日 星期一

compile ipmitool 1.8.13

  1. remove freeipmi first
    # make uninstall (from freeipmi-1.4.9) don't know why
    # make clean 
  2. yum install ncurses-* readline-* openssl-*
  3. tar xvjf ipmitool-1.8.13.tar.bz2; cd ipmitool-1.8.13
  4. ./configure && make
  5. make install
  6. Enter freeipmi source code folder (need install libgcrypt-devel before compiler freeipmi)
    # ./configure
    # make
    # make install
Do build freeipmi
# yum install libgcrypt-devel

2013年5月7日 星期二

cntlm

讓Linux可透過Windows Server的Proxy (NTLM) 連到外面去
Cntlm
設定檔
/etc/cntlm.conf

restart the system and cntlm will run automatically
執行檔
/usr/sbin/cntlm

set http_proxy variable
# export http_proxy=http://127.0.0.1:3128

iptables 開通port 80

# iptables -I INPUT -p tcp ––dport 80 -j ACCEPT