2016/09/17

Published 9月 17, 2016 by

房貸問題詢問

貸款日期:
房貸問題詢問方式(Tel):
總貸款費用:XXX萬元
貸款費用(是否有特約廠商,0~6000):
房子鑑價費用(0~3000):
綁保險商品(是/否):共XXXX萬
清償綁約(還清負債):n年,違約計算方式?
註銷綁約(轉貸或賣房):n年,違約計算方式?
利率計算方式:x.xxx%一段式利率,I+固定利率
利率調整方式:年/季/月調整一次
寬限期延長費用:XXXX
還款方式(下限?):
叩款銀行:
每月叩款時間:
Read More

2016/09/05

Published 9月 05, 2016 by

備份及回存Linux的權限及Owner

備份及回存Linux的權限及Owner

備份權限及Owner:
find * -depth -exec stat --format '%a %u %g %n' {} + >/tmp/save-the-list

回存權限及Owner:
 while read PERMS OWNER GROUP FILE 
 do 
     chmod "$PERMS" "$FILE" 
     chown "${OWNER}:${GROUP}" "$FILE" 
 done </tmp/save-the-list 

保存的檔案內容如下(以相對目錄存放)
目前權限 Owner Group Directory/file
775 2001 2001 test_file/old_version
644 2001 2001 tester_file/direct.sh
644 0 0 tes_file/123.sh
644 2001 2001 test_file/update.sh
755 2001 2001 test_file

Reference:


Read More

2016/09/04

Published 9月 04, 2016 by

Linux Script 二進位編碼 加密


Linux Script編碼

gzexe(gzip executable) 
功能說明:壓縮執行文件。

語  法:
編碼:gzexe [執行文件]à產生二進位檔,一般人看不懂裡面內容
反解:gzexe [-d][執行文件]

補充說明:gzexe是用來壓縮執行文件的程序。當您去執行被壓縮過的執行文件時,該文件會自動解壓然後繼續執行,和使用一般的執行文件相同。

參  數:
 -d  解開壓縮文件。


shc方法
shc是一個加密shell腳本的工具.它的作用是把shell腳本轉換爲一個可執行的二進制文件
shc 安裝方式:
# tar -xzf shc-3.8.7.tgz
# cd shc-3.8.7
# make
# ./shc -v -f match

使用以上的方式編譯 Shell,只能在相同的作業系統上執行,若要在不同的作業系統上也能執行,則要以 static library 方式,指令如下
export CFLAGS=-static && ./shc -r -f myshell
如果要設定期限
export CFLAGS=-static && ./shc -e 19/10/2011 -r -f PIAF-install-ec2.sh
如何檢查執行檔是 static dynamic library
file myshell.x
如果yum不能安裝,請移步官方下載rpm
http://pkgs.repoforge.org/shc/
http://www.datsi.fi.upm.es/~frosal/sources/

Reference:
SHC說明:

文章說明:

Read More

2016/08/31

Published 8月 31, 2016 by

台幣定存-定期存款 、定期儲蓄存款介紹


 1 件事、搞懂定存種類
定存只有 1 
定儲卻再分 3 
台幣定存分成 2 大項目
定期存款和定期儲蓄存款
而定期儲蓄存款又可再分成
零存整付、整存整付和存本取息 3 種類別。
銀行為因應政府鼓勵民眾儲蓄
定期儲蓄存款的利率通常會比定期存款略高

「定期儲蓄」存款存期長、門檻低 「定期存款」存期短、門檻高

 2 件事、瞭解利息計算方式
「定期存款」為單計利息
「整存整付」為複計利息 【勝】


 3 件事、利率分固定和機動
低利率的時候選「機動」
高利率的時候選「固定」



Read More

2016/08/30

Published 8月 30, 2016 by

VNC Server架設

VNC Server架設
環境:RHEL 6.4 64bit
Vncserver:內建, libvncserver-0.9.7-4.el6.x86_64

Server端:
輸入VNCServer
[root@test1 ~]# vncserver

You will require a password to access your desktops.

Password:ß輸入密碼
Verify: ß輸入密碼

New 'test1:1 (root)' desktop is test1:1

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/test1:1.logßlog file


Check VNC Status:


[root@test1 ~]# vncserver -list

TigerVNC server sessions:

X DISPLAY #     PROCESS ID
:1              43468

Client:
主機名稱:test1
Port:5901


Read More
Published 8月 30, 2016 by

Iperf網路測試軟體

iperf網路測試軟體

需安裝Client & Server
Server:
iperf3 -s

Client:
iperf3 -c 192.12.1.2  -t 10 -i 5 -M 1500
#-c : server IP
#-t : 測量時間間隔為10
#-i : 每隔 5 秒將測量結果顯示出來,最後再算出平均值.
#-w :測試的檔案大小
#-R :反相測試
#-M :設定TCP資料封包的最大mtu
#-p :指定伺服端使用的port或客戶端所連接的port
#-u :使用udp協議

通用參數

-f [k|m|K|M] 分別表示以Kbits, Mbits, KBytes, MBytes顯示報告,預設以Mbits為單位,eg:iperf -c 192.12.1.2 -f K
-i sec 以秒為單位顯示報告間隔,eg:iperf -c 192.12.1.2 -i 2
-l 緩衝區大小,預設是8KB,eg:iperf -c 192.12.1.2 -l 16
-m 顯示tcp最大mtu
-o 將報告和錯誤信息輸出到檔案eg:iperf -c 192.12.1.2 -oc:\iperflog.txt
-p 指定服務器端使用的端口或客戶端所連接的端口eg:iperf -s -p 9999;iperf -c 192.12.1.2 -p 9999
-u 使用udp協議
-w 指定TCP窗口大小,預設是8KB
-B 綁定一個主機地址或通訊埠(當主機有多個地址或通訊埠時使用該參數)
-C 兼容舊版本(當server端和client端版本不一樣時使用)
-M 設定TCP資料封包的最大mtu
-N 設定TCP不延時
-V 傳輸ipv6資料封包

Reference:
教學
http://benjr.tw/462
Download
https://iperf.fr/iperf-download.php#source
Read More

2016/05/13

Published 5月 13, 2016 by

新增User出現41-digit hexadecimal加密問題

新增User出現41-digit hexadecimal加密問題

說明:
Windows新的版本,使用新的加密方式,必需要更改新的加密方式:
old_passwords=0àoff

Linux版本,是使用舊的加密方式。

Q1:Create User出現Password hash should be a 41-digit hexadecimal number

mysql> CREATE USER 'testaccount'@'127.0.0.1' IDENTIFIED BY PASSWORD 'asdf';
ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number


A:
查看old_passwords,Default ON,代表可以使用舊的加密方式
mysql> SHOW variables like '%old_password%';

# old_passwords=0àoff
# old_passwords=1àon

mysql> set old_passwords=0;

查看加密完的密碼:

重新設定密碼:
mysql> SET PASSWORD FOR 'testaccount'@'127.0.0.1' = ' *7F0C90A004C46C64A0EB9DDDCE5DE0DC437A635C ';


Reference:




Read More

2016/02/21

Published 2月 21, 2016 by

限制User使用sftp在家目錄,並加入log file

限制User使用sftp在家目錄,並加入log file
一、環境說明:
Red Hat Enterprise Linux Server release 6.7 (Santiago)
# sshd -v
sshd: illegal option -- v
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
rsyslog-5.8.10

二、設置ssh 設定
1.針對user設置:
# vi /etc/ssh/sshd_config 
Subsystem       sftp    internal-sftp -f AUTHPRIV -l VERBOSE -u 0002 -f LOCAL6
Match user schuang
    ChrootDirectory /home/sftpuser
    X11Forwarding no
    AllowTcpForwarding no
   ForceCommand internal-sftp -u 0002 -l VERBOSE -f LOCAL6

設置(針對Group設置)
# vi /etc/ssh/sshd_config 
Subsystem       sftp    internal-sftp -f AUTHPRIV -l VERBOSE -u 0002 -f LOCAL6
Match group sftponly
         ChrootDirectory /home/%u
         X11Forwarding no
         AllowTcpForwarding no
         ForceCommand internal-sftp

三、修正使用者帳戶的家目錄權限
家目錄必需是要root,且最大的權限為755(為了不給user切換到另一目錄)
#chown root.root /home/sftpuser
#chmod 755 /home/sftpuser

. 在使用者目錄下建立允許上傳檔案的目錄
建立可上傳目錄,並賦予適當的目錄權限
#cd /home/sftpuser
#mkdir upload
#chown sftpuser.sftpuser upload
五、建立登入log file
#cd /home/sftpuser
#mkdir dev

# vi /etc/rsyslog.conf 
local6.*                                                /var/log/sftp.log
$AddUnixListenSocket /home/sftpuser/dev/log

# service rsyslog restart
#service sshd restart
#tail -f /var/log/sftp.log


Error message:
fatal: bad ownership or modes for chroot directory
因沒有加入到root群組
請做第三步驟。

參考檔案:
Sftp Install 1:
Sftp Install 2:
Sftp log:  
http://gdcsy.blog.163.com/blog/static/12734360920145632946993/

Read More
Published 2月 21, 2016 by

Linux online IOscan - Fiber LUN Volumn Scan

#for i in /sys/class/fc_host/host*; do (cd $i; echo -e "$(echo $i)\t$(cat port_name)\t$(cat port_state)\t$(cat speed)"); done

/sys/class/fc_host/host3        0x5001438021e1c508      Online  8 Gbit
/sys/class/fc_host/host4        0x5001438021e1c50a      Linkdown        unknown
/sys/class/fc_host/host5        0x5001438021e1c3e0      Online  8 Gbit
/sys/class/fc_host/host6        0x5001438021e1c3e2      Linkdown        unknown

可以看出host3host5Onlie

重新掃瞄:
echo "1" > /sys/class/fc_host/host3/issue_lip
echo "1" > /sys/class/fc_host/host5/issue_lip

查看StorageLun
#fdisk -l

Read More

2015/12/18

Published 12月 18, 2015 by

30條投資人必學的操作精華,你錯過就虧大了!

30條投資人必學的操作精華,你錯過就虧大了!

  • 2015/12/16 11:53:37
  • 4541
  • 0
把曾經寫過卻四散在各處的操作技巧再整理一次給你
1.遇到長黑棒不一定會死,只要三天內漲過長黑高點,就是良性換手,續漲機會大;
2.定存股買點之下不需停損,但是要觀察獲利變化,想賺價差的股票不要做成定存股,那是悲劇;
3.不要在股票呈現多頭排列的時候猜頭部放空,應該是等股票呈現空頭排列時等反彈放空;
4.看成交量找底部時需要觀察一陣子,看成交量找頭部時只要看三天;
5.股票漲了一陣子之後出現連續性長紅爆量,請隨時準備賣出,主力很可能邊拉邊出貨;
6.帳上獲利夠大時,不妨把停損設寬一點,以防隨便就被洗掉;
7.買進股票之後遇到修正卻"有支撐"時加碼,除非是起漲點,不然別在長紅棒之後加碼;
8.多頭時看基本面,有賺錢的公司比較會漲,空頭時看技術面,有人撐的公司比較抗跌;
9.買股票前請先想好這次是要賺價差還是賺配息,不要套牢之後捨不得賣就改稱要賺配息;
10.你來市場是為了賺錢,不是為了怕無聊,所以永遠不要為了操作而操作;
11.高檔出現一根長黑後,三天內沒法漲過長黑高點,最好出清股票;
12.股價在高檔,常有突破整理的誘多舉動,但要小心是假突破真下跌,跌破長紅低點要立刻出清,甚至反手放空;
13.表現比大盤還強勢的股票遇到"回檔量縮"就是加碼機會;
14.股票漲了一段之後,強勢整理,修正到整理區間下緣時進場,出現長紅或突破整理區間立即加碼,因為很可能會再衝一波;
15.操作常遇到的事,賣掉股票以後,股價繼續上漲,建議不要再追高,通常會後悔;
16.電視報紙看好,但股價卻不漲,務必先出場。說錯了,應該是只要媒體看好,不管股價有沒有漲都要馬上賣掉;
17.當多條均線糾結在一起的時候,不要預設多空,等長紅或長黑出現馬上跟進;
18.當強勢股出現"下跌量增"的時候,請小心,因為它轉弱了;
19.遇到非經濟因素的利空,三天內沒再破底就該逢低買進,例如地震、政治、恐怖攻擊;
20.賠錢的狀況下攤平是加速賠錢,獲利的狀況下加碼是加速賺錢;
21.下跌趨勢中,沒有出現加速趕底的長黑棒絕對不搶反彈;
22.股價處於低檔,但是開始形成多頭排列,而且大盤也處於多頭,遇到修正都是買點;
23.出現烏雲罩頂是多頭悲劇,建議先出掉看看狀況再說,下跌機率很大;
24.漲了一陣子出現長黑或多次長上影線,請賣掉,除非後來能漲過上影線和長黑高點,不然就是壽終正寢了;
25.出現爆量不漲或只有小漲,十之八九是主力在出貨;
26.跌破長期趨勢線,先退出觀望,反彈之後時常大跌;
27.當股價"跳空"跌破走了許久的趨勢線,而且盤中站不回去,多頭已死,節哀順變;
28.如果大盤類股輪動快速,任意換股常被套,要就手腳夠快賺一點就跑,不然就以不變應萬變,不隨便換股,因為總會輪到你的股票漲;
29.融資跟著大盤上漲是好事,沒有哪次的大多頭是單靠法人買出來的,散戶一定要跟進才有大行情;
30.買股可以多考慮幾天,但是停損一定要果決迅速,只要跌破停損點,不思考立刻出掉。
覺得對你有幫助嗎?順手分享給朋友吧!

參考資料:http://w.wantgoo.com/119/1762
Read More

2015/12/14

Published 12月 14, 2015 by

投資失敗者的七大特點

作者:田曉艷 2015年12月13日15:04:06
在投資的問題上,知道如何不虧錢和知道如何賺錢一樣重要。
這是美國紐約Ritholtz財富管理公司(Ritholtz Wealth Management)Ben​​ Carlson,在同名的新書及博客“A Wealth of Common Sense”中明確表達的觀點。
Ben Carlson認為,最優秀的投資者知道如何走自己的路。“這並不意味著他們當下所做的每個決定都是正確的,實際上這也是不可能的。但隨著時間推移,做出足夠多的好決策並減少必要的失誤,成功的概率自然就會比其他人高很多。”
聽起來很簡單,實際上卻並非如此,Carlson指出,投資者總是在重複犯相同的基本錯誤,例如追漲殺跌。
Carlson總結的投資失敗者的七大特點是:
1:希望一夜暴富。失敗者總認為股市像一個賭場,在裡面快速取得成功的都是幸運兒。記住,那些到處做廣告號稱能讓你快速致富的人都可以屏蔽了。如果他們真的這麼厲害,他們不會願意把秘訣告訴別人的。
2:在沒有既定計劃的情況下投資。這是失敗的一大“保證”因素。這意味著投資者要在緊急情況下依賴直覺做出判斷,而成功者恰是相反的。
3:不獨立思考。有時候多數人的觀點是對的。但每次大的金融泡沫都是由一大批認為資產將不斷升值的人引發的。當多數人的觀點是錯誤的時候,災難將不可避免。
4:注重短期回報。因地緣政治及新聞周期而重視起當下事件是很容易的。但是,這些事通常不在投資者控制範圍內,且發生速度很快,投資者也不可能確切知道市場每天因何而動。
5:關注那些不在你控制範圍內的東西。例如上一條提到的新聞事件。成功投資者關注的事情是理性的資產配置,降低成本及明確自己的風險承受能力。
6:將市場個人化。這種情況往往伴隨著把自己的失誤歸咎於別人,而不是探究是否存在戰略性錯誤。問題並非出在市場身上,而是與你個人有關。當損失來臨時,成功投資者能坦然接受,因為知道這是不可避免的。
7:否認個人的局限性。“過度自信是最大的財富毀滅因素之一。”這也就說明為什麼多樣化是很重要的,因為它為任何錯誤都提供了余地,類似本傑明·格雷厄姆的“安全邊際”。
參考資料:http://blog.moneydj.com/digest/2015/12/13/a-wealth-of-common-sense/
Read More
Published 12月 14, 2015 by

Linux VI 及 目錄變更顏色

vi變更顏色:
設定在個人家目錄:
[root@ap811 ~]#cat .bashrc
# .bashrc
alias vi='vim'

##設定套件顏色
[root@ap811 ~]#cat .vimrc
:color desert


目錄變更顏色:
先確認是使用那一個file
[root@ap811 ~]# set | grep DIR
COLORS=/etc/DIR_COLORS.xterm

尋找DIR參數,變更後面的參
vi /etc/DIR_COLORS.xterm
# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00       # global default, although everything should be something.
FILE 00         # normal file
DIR 00;33       # directory
…..

若是要設定在個人,設定方式如下:
[schuang@ap811 ~]#cp /etc/DIR_COLORS /userap/schuang/DIR_COLORS

變更DIR欄位顏色
[schuang@ap811 ~]#vi /userap/schuang/DIR_COLORS
DIR 00;33       # directory

登錄自動登錄,新增以下這一段:
[schuang@ap811 ~]#vi .bashrc
eval `dircolors --sh /userap/schuang/DIR_COLORS`

Read More
Published 12月 14, 2015 by

SAR-系統效能判斷

系統效能判斷:

要判斷系統瓶頸問題,有時需幾個 sar 命令選項結合起來;
懷疑CPU存在瓶頸,可用 sar -u sar -q 等來查看
懷疑記憶體存在瓶頸,可用sar -Bsar -r sar -W 等來查看
懷疑I/O存在瓶頸,可用 sar -bsar -u sar -d 等來查看
使用方式:
#sar -u 1 100(1秒執行一次,執行100)


-A     等價於 -bBcdqrRuvwWy -I SUM -I XALL -n ALL -P ALL
-b     顯示I/O和傳送速率的統計資訊
-B     輸出記憶體頁面的統計資訊
-c     輸出進程統計資訊,每秒創建的進程數
-d     輸出每一個塊設備的活動資訊
-i interval        指定間隔時長,單位為秒
-p     顯示友好設備名字,以方便查看,也可以和-d -n 參數結合使用,比如 -dp -np
-q     輸出進程佇列長度和平均負載狀態統計資訊
-r     輸出記憶體和交換空間的統計資訊
-R     輸出記憶體頁面的統計資訊
-t      讀取 /var/log/sa/saDD 的資料時顯示其中記錄的原始時間,如果沒有這個參數使用用戶的本地時間
-u     輸出CPU使用情況的統計資訊
-v     輸出inode、檔和其他內核表的統計資訊
-V     輸出版本號資訊
-w    輸出系統交換活動資訊
-W   輸出系統交換的統計資訊
-y     輸出TTY設備的活動資訊
-n {DEV|EDEV|NFS|NFSD|SOCK|ALL}    分析輸出網路設備狀態統計資訊。
DEV 報告網路設備的統計資訊
EDEV       報告網路設備的錯誤統計資訊
NFS  報告 NFS 用戶端的活動統計資訊
NFSD        報告 NFS 伺服器的活動統計資訊
SOCK       報告網路通訊端(sockets)的使用統計資訊
ALL  報告所有類型的網路活動統計資訊
-x {pid|SELF|ALL}    輸出指定進程的統計資訊。
pid   pid 指定特定的進程
SELF 表示 sar 自身
ALL  表示所有進程
-X {pid|SELF|ALL}    輸出指定進程的子進程的統計資訊
-I {irq|SUM|ALL|XALL}   輸出指定中斷的統計資訊。
irq    指定中斷號
SUM        指定輸出每秒接收到的中斷總數
ALL  指定輸出前16個中斷
XALL        指定輸出全部的中斷資訊
-P {cpu|ALL}    輸出指定 CPU 的統計資訊
-o filename     將輸出資訊保存到檔 filename
-f filename      從檔 filename 讀取資料資訊。filename 是使用-o 選項時生成的檔。
-s hh:mm:ss     指定輸出統計資料的起始時間
-e hh:mm:ss    指定輸出統計資料的截至時間,預設為18:00:00


參考資料:http://linuxtools-rst.readthedocs.org/zh_CN/latest/tool/sar.html

Read More
Published 12月 14, 2015 by

Install NetBackup Client Linux/Unix From Master Server


一、系統環境說明
1.      NBU Server Path:/usr/openv/netbackup/client/Linux/RedHat2.6.18
2.      Client OS version:RHEL, kernel:2.6.18
3.      aptestb原本nbu client為7.5,升級為7.6.03

二、透過SSH Login Install
1.      先建立免密碼的ssh key
2.      執行安裝:


[root@nbuserver /usr/openv/netbackup/client/Linux/RedHat2.6.18]# ./ssh_to_client aptestb
installpbx                           100%   53KB  53.2KB/s   00:00
PBX.tar.gz                           100% 9062KB   8.9MB/s   00:00
pdinstall                            100%   27KB  27.1KB/s   00:00
pddeagent.tar.gz                     100%   34MB  33.7MB/s   00:01
JRE.tar.gz                           100%   44MB  43.9MB/s   00:00
.sizes_JRE                           100%    6     0.0KB/s   00:00
NB-Java.tar.gz                       100%  199MB  66.3MB/s   00:03
.sizes_NB-Java                       100%    7     0.0KB/s   00:00
JAVAnbj.conf.aptestb.16318            100%  668     0.7KB/s   00:00
cp_to_client                         100%   90KB  89.9KB/s   00:00
extract_java                         100%   22KB  22.3KB/s   00:00
install_client                       100%   31KB  30.7KB/s   00:00
nbcheck                              100%   11MB  11.2MB/s   00:00
version                              100%   31     0.0KB/s   00:00
tar                                  100%  370KB 369.6KB/s   00:00
.sizes                               100%   15     0.0KB/s   00:00
.sizes_client_bin                    100%    7     0.0KB/s   00:00
client_config                        100%  100KB  99.5KB/s   00:00
aptestb_bin_net.tar.16318             100%   10KB  10.0KB/s   00:00
client_bin.tar.gz                    100%  158MB  79.1MB/s   00:02
Checking for SYMCpddea package...
   Package SYMCpddea found.

NetBackup Deduplication software is installed.

NetBackup Deduplication is not yet configured.


Checking for required system conditions...


Checking for recommended system conditions...

ok nb_7603_hotfix_auditor: No potential for regression of hotfixes or EEBs was detected.
Blocksize = 20 records
./
./bp_servers
./bp_client_name

Terminating NetBackup and/or Media Manager processes.

Saving pack history as /usr/openv/pack.7.5

Saving client binaries for Linux/RedHat2.6.18.

Installing PBX...
Please wait while installation is in progress...
Installation completed Successfully
Installation log located here: /var/tmp/installpbx-18177-120715140809.log


Unpacking SYMCnbclt package.
Checking for pre-existing SYMCnbclt package.
Removing pre-existing SYMCnbclt package.
Installing SYMCnbclt package.
Installation of SYMCnbclt was successful.
More details regarding SYMCnbclt can be found in file
/tmp/install_cltpkg_trace.17102 on aptest.

Terminating NetBackup and/or Media Manager processes.

Send a SIGHUP to (x)inetd so the (x)inetd.conf file will be reread.
Reloading configuration: [  OK  ]
Installing NB-Java.

Unpacking SYMCnbjava package.
Checking for pre-existing SYMCnbjava package.
Removing pre-existing SYMCnbjava package.
Installing SYMCnbjava package.
Installation of SYMCnbjava was successful.
More details regarding SYMCnbjava can be found in file
/tmp/install_javapkg_trace.19505 on aptest.

Unpacking SYMCnbjre package.
Checking for pre-existing SYMCnbjre package.
Removing pre-existing SYMCnbjre package.
Installing SYMCnbjre package.
Installation of SYMCnbjre was successful.
More details regarding SYMCnbjre can be found in file
/tmp/install_jrepkg_trace.19505 on aptest.

WARNING: Copying /usr/openv/netbackup/nblog.conf to
         /usr/openv/netbackup/nblog.conf.12-07-15.14:07:12
         for future reference.  Any local modifications to
         /usr/openv/netbackup/nblog.conf should be re-evaluated.


Migrating log files in /usr/openv/logs
Migration of log files complete.

Checking for SYMCpddea package...
   Package SYMCpddea found.
Removing SYMCpddea package...
   Package SYMCpddea removed.
Installing PDDE agent package (/tmp/bp.16318/openv/netbackup/client/Linux/RedHat2.6.18/pddeagent.tar.gz)...
Extracting package SYMCpddea in /tmp/pdde_pkg_dir_20076.
   Package SYMCpddea extracted to /tmp/pdde_pkg_dir_20076.
Installing package SYMCpddea.
   Package SYMCpddea installed.
PDDE install finished successfully.
Version now installed: 8.0003.0014.0530
Full PDDE installation log saved to: /var/log/puredisk/2015-12-07_14:08-pdde-install.log


WARNING: Copying /etc/rc.d/init.d/netbackup to
         /usr/openv/netbackup/bin/goodies/netbackup.12-07-15.14:07:12
         for future reference.  Any local modifications to
         /etc/rc.d/init.d/netbackup should be re-evaluated.


The following automatic startup and shutdown scripts (respectively)
have been installed.  They will cause the NetBackup daemons to be
automatically shut down and restarted each time the system boots.

/etc/rc.d/rc2.d/S77netbackup
/etc/rc.d/rc3.d/S77netbackup
/etc/rc.d/rc5.d/S77netbackup
/etc/rc.d/rc0.d/K01netbackup
/etc/rc.d/rc1.d/K01netbackup
/etc/rc.d/rc6.d/K01netbackup


Successfully updated the session cache parameters.
Starting vnetd...
Starting bpcd...
Starting nbftclnt...
Starting nbdisco...
Starting mtstrmd...
Starting bmrbd...

Installation of Java LiveUpdate agent succeeded.  Refer to file
/tmp/JLU-Log/JavaLiveUpdate-Install.log on aptest
for installation details.


Checking LiveUpdate registration for the following products: CLT
This may take a few minutes.

Product CLT is installed and will be registered.

Updating LiveUpdate registration now...this may take some time.


Client install complete.

INF OTHER - EXIT STATUS = 0


三、確認版本及Client重啟
[root@aptest ~]# cat /usr/openv/netbackup/bin/version
[root@aptest ~]#/etc/init.d/netbackup stop/start

Read More

2015/10/21

Published 10月 21, 2015 by

Samba Domain Integration-Samba加入Windows 2008網域

Samba Domain Integration-Samba加入Windows 2008網域
所需檔案:
yum install samba
yum install krb5-server
yum install krb5-workstation
yum install samba-winbind

DC
IP: 192.168.3.48
Hostname:dc123
domainabc.example.com.tw

RHEL 6.5 X64
HOSTNAME:test1

設定步驟:
一、設定Hostname,
[root@test1 samba]# vi /etc/sysconfig/network
HOSTNAME=test1

二、Samba設定:
[root@test1 samba]# vi /etc/samba/smb.conf
[global]
   workgroup = DOM
   password server = dc123.abc.example.com.tw #密碼server指定ad server
   realm = abc.EXAMPLE.COM.TW #完整網域名稱
   security = ads #認證方式交給ad認證
   encrypt passwords = yes #編碼方式傳遞密碼
   idmap config * : range = 16777216-33554431 #修改UIDGID的範圍及目錄
   template shell = /bin/bash #指定AD帳號的SHELL
   winbind enum users = yes
   winbind enum groups = yes
   winbind use default domain = yes
   template homedir =  /home/%D/%U

        server string = EXAMPLE TEST Server #描述
        netbios name = test1 #Linux主機名稱

        # logs split per machine
        log file = /var/log/samba/%m.log #Log message
        # max 50KB per log file, then rotate
        max log size = 102400 #最大的檔案

[TMP]
        comment         = For tmp
        path            = /tmp
        browseable      = yes
        writable        = yes
        valid users     = @"DOM\FS99_test_rw"
        create mask     = 0644
        directory mask  = 0750

三、DNS/認證順序設定:
[root@test1 samba]# cat /etc/resolv.conf
search abc.example.com.tw example.com.tw
nameserver 192.168.3.48
nameserver 192.168.3.47
options timeout:1
options attempts:1 rotate

[root@test1 samba]# vi /etc/nsswitch.conf
passwd:     files winbind
shadow:     files winbind
group:      files winbind
hosts:      dns files

四、Kerberos認證設定:
[root@test1 samba]# vi /etc/krb5.conf
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log

[libdefaults]
default_realm = abc.example.com.tw
dns_lookup_realm = true
dns_lookup_kdc = true
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
[realms]
abc.example.com.tw = {
  kdc = dc123.abc.example.com.tw
  kdc = dc35.abc.example.com.tw
  admin_server = dc123.abc.example.com.tw
  default_domain=abc.example.com.tw
}

[domain_realm]
abc.example.com.tw = abc.example.com.tw
.abc.example.com.tw = abc.example.com.tw
DOM = abc.example.com.tw
.DOM = abc.example.com.tw

五、samba/winbind 服務啟動,並設定開機自動啟動該服務
# service smb start
# chkconfig smb on
# service winbind start
# chkconfig winbind on


六、測試連線
[root@test1 ~]# kinit sidney@abc.EXAMPLE.COM.TW

PS.網域一定要大寫,小寫會出錯
七、Linux主機加入/退出網域
加入網域:
[root@test1 ~]# net ads join -U sidney@abc.example.com.tw
Using short domain name -- DOM
Joined 'TEST1' to dns domain 'abc.example.com.tw'

或用以下的方式加入網域:
net ads join -S abc.example.com.tw
net rpc join -S abc.example.com.tw
net ads join -U sidney@abc.example.com.tw
net rpc join -U sidney@abc.example.com.tw
net rpc join -U sidney

退出網域方式:
net ads leave -U sidney@abc.example.com.tw

八、設定NTP(同步時間和domain不能超過5分鐘)

[root@test1 ~]# cat /etc/ntp.conf 
server 192.168.6.86
server 192.168.6.87

九、Check:
確認連線
[root@test1 ~]# wbinfo -t
checking the trust secret for domain DOM via RPC calls succeeded

確認網域資訊
[root@test1 ~]# net ads info
LDAP server: 192.168.3.48
LDAP server name: dc123.abc.example.com.tw
Realm: abc.EXAMPLE.COM.TW
Bind Path: dc=HS,dc=EXAMPLE,dc=COM,dc=TW
LDAP port: 389
Server time: Thu, 15 Oct 2015 15:19:39 CST
KDC server: 192.168.3.48
Server time offset: 0

確認user資訊:
[root@test1 ~]# wbinfo -i sidney

確認domain user資訊:
[root@test1 ~]# wbinfo -i


十、文字介面設定:

#setup
設定授權:
選擇授權方式:Winbind & Kerberos




輸入網域資料
認證選擇ads認證
輸入帳密

做認證過程中的錯誤訊息:


十一、        錯誤記錄

[root@test1 samba]# cat /var/log/krb5kdc.log
krb5kdc: No such file or directory - while initializing database for realm abc.example.com.tw
krb5kdc: No such file or directory - while initializing database for realm abc.example.com.tw

[root@test1 samba]# kdb5_util create -s -r abc.example.com.tw
Loading random data
Initializing database '/var/kerberos/krb5kdc/principal' for realm 'abc.example.com.tw',
master key name 'K/M@abc.example.com.tw'
You will be prompted for the database Master Password.
It is important that you NOT FORGET this password.
Enter KDC database master key:
Re-enter KDC database master key to verify:
[root@test1 samba]# service krb5kdc restart
Stopping Kerberos 5 KDC:                                   [FAILED]
Starting Kerberos 5 KDC:                                   [  OK  ]

十二、        相關Reference:

Read More