PIXNET Logo登入

蒼芎技術筆記本

跳到主文

有關電腦相關設定與使用網站

部落格全站分類:職場甘苦

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 5月 09 週四 201310:35
  • 無法開啟限額設定quotacheck -aucmv

[root@centos ~]# quotacheck -aucmv
quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown.
quotacheck: Scanning /dev/sda4 [/iii] done
quotacheck: Cannot stat old user quota file: 沒有此一檔案或目錄
quotacheck: Old group file not found. Usage will not be substracted.
quotacheck: Checked 2 directories and 0 files
quotacheck: Cannot create new quotafile /iii/aquota.user.new: 拒絕不符權限的操作
quotacheck: Cannot initialize IO on new quotafile: 拒絕不符權限的操作

要關閉seLinux

[root@centos ~]# setenforce 0

[root@centos ~]# quotacheck -aucmv
quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown.
quotacheck: Scanning /dev/sda4 [/iii] done
quotacheck: Cannot stat old user quota file: 沒有此一檔案或目錄
quotacheck: Old group file not found. Usage will not be substracted.
quotacheck: Checked 2 directories and 0 files
quotacheck: Old file not found.

可以了

(繼續閱讀...)
文章標籤

蒼穹 發表在 痞客邦 留言(1) 人氣(341)

  • 個人分類:系統
▲top
  • 3月 01 週五 201315:38
  • Windows Server 2008 R2 變更AD的密碼原則

1.[開始]->[群組原則管理]

2.點選[Default Domain Policy]->右邊[設定]分頁簽

3.點開[安全性設定]->[帳戶原則/密碼原則]->案右鍵編輯

4.展開[電腦設定]>[原則]>[Windows設定]>[安全性設定]>[帳戶原則]>[密碼原則]

(繼續閱讀...)
文章標籤

蒼穹 發表在 痞客邦 留言(0) 人氣(4,354)

  • 個人分類:WinXP
▲top
  • 1月 04 週五 201311:11
  • 使用Vmware 安裝 CentOS6.3 網路啟動問題

當我在Vmware安裝好CentOs後,網路無法開啟會顯示,如下訊息

RTNETLINK answers: cannot allocate memory

作法:

將CentOS關機,進去VM的edit將目前的網路設備刪除,加入一個新的使用[‘VMXNET3],開啟CentOS搞定

(繼續閱讀...)
文章標籤

蒼穹 發表在 痞客邦 留言(0) 人氣(370)

  • 個人分類:系統
▲top
  • 1月 04 週五 201310:40
  • CentOS6_32 安裝 vmware-tools 的問題

在CentOS32安裝vmware-tools後會發生,如下的訊息

bash: ./vmware-install.pl: 權限不夠

所以我移除虛擬CentOS重新安裝後使用下方的指令安裝就可以成功

perl ./vmware-install-tools.pl => 成功

(繼續閱讀...)
文章標籤

蒼穹 發表在 痞客邦 留言(0) 人氣(105)

  • 個人分類:系統
▲top
  • 12月 21 週五 201216:37
  • Centos6.3 install clamav0.97.6.1

1.下載clavam檔案

wget http://pkgs.repoforge.org/clamav/clamav-0.97.6-1.el6.rf.i686.rpm
wget http://pkgs.repoforge.org/clamav/clamav-db-0.97.6-1.el6.rf.i686.rpm
wget http://pkgs.repoforge.org/clamav/clamav-devel-0.97.6-1.el6.rf.i686.rpm
wget http://pkgs.repoforge.org/clamav/clamd-0.97.6-1.el6.rf.i686.rpm

2.安裝Clamav

#rpm -Uvh clam*

(繼續閱讀...)
文章標籤

蒼穹 發表在 痞客邦 留言(0) 人氣(218)

  • 個人分類:系統
▲top
  • 6月 21 週二 201123:57
  • Ubuntu10 Iptables 防火牆+NAT+port forward

當架好Ubuntu Linux後,可以進階使用Iptables功能,將Ubuntu變成一台Router並對應到內部的IP開放相關服務,如[ftp][www]...等等。
環境介紹:
Server端
兩張網卡:當然你也可以將一張網卡給兩個IP
eth0:192.168.10.10 ===>外部IP
eth1:192.168.20.10 ===>內部IP(所有內網LAN透過這IP當作Gateway出去)

PC端網路卡設定
IP Address:192.168.20.20
Gateway:192.168.20.10

Server設定如下所示:
一、將以下這段文字寫入rc.local檔案,這樣重新啟動Linux就會載入這些設定。
#vim /etc/rc.local  

#!/bin/sh
##### iptables.rule #####
EIF="eth0" # 對外的網路介面
IIF="eth1" # 對內的網路介面
INNET="192.168.20.0/24" # 內部子網域

# forwarding
# 讓內部網路的封包可以轉送到外部
echo "1" > /proc/sys/net/ipv4/ip_forward

# flush all rules
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X

# 定義 policy
# Policy指的是當進來的封包不屬於rule中的任何一條時,所預設的動作。
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

# localhost
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

# 讓主機主動建立的連線可以進來
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

# 設定主機上提供的服務可讓外部網路存取
iptables -A INPUT -i $EIF -p tcp --dport 22 -j ACCEPT # ssh
iptables -A INPUT -i $EIF -p udp --dport 22 -j ACCEPT
iptables -A INPUT -i $EIF -p tcp --dport 80 -j ACCEPT # http

# NAT 內部區域透過NAT瀏覽外網
iptables -t nat -A POSTROUTING -o $EIF -s $INNET -j MASQUERADE

#將80port對應到內部IP 192.168.20.20
iptables -t nat -A PREROUTING -p tcp -i $EIF --dport 80 -j DNAT --to-destination 192.168.20.20:80 # WWW

二、重新啟動Linux
#sudo reboot

測試看看是否只有提供ssh與www服務而已,開啟IE連接192.168.10.10,應該會導入到192.168.20.20的網頁。

(繼續閱讀...)
文章標籤

蒼穹 發表在 痞客邦 留言(4) 人氣(13,188)

  • 個人分類:Server Edition
▲top
  • 6月 21 週二 201117:03
  • Ubuntu10 DHCP Server 安裝與設定

Ubuntu10 安裝DHCP Server設定,兩張網卡eth0 eth1
eth0:192.168.66.128
eth1:192.168.137.128
將eth1設定為dhcp網段

1.安裝DHCP Server
#apt-get install dhcp3-server

2.設定將eth1網段使用DHCP
#vim /etc/default/dhcp3-server
INTERFACES="eth1"

3.設定分發IP
#vim /etc/dhcp3/dhcpd.conf
檔案裡面有分全域變數與區域變數

subnet 192.168.137.0 netmask 255.255.255.0 {
    #設定Gateway
    option routers 192.168.137.128;
    option subnet-mask 255.255.255.0;
    #設定DNS
    option domain-name-servers 168.95.1.1 ,168.95.192.1;
    #設定分配的IP區段
    range dynamic-bootp 192.168.137.10 192.168.137.20;
    default-lease-time 21600;
    max-lease-time 43200;

}


設定固定MAC Address給予固定IP Address
host Server {
  #要固定的MAC Address
  hardware ethernet 00:12:34:qw:14:14;

(繼續閱讀...)
文章標籤

蒼穹 發表在 痞客邦 留言(0) 人氣(596)

  • 個人分類:Server Edition
▲top
  • 5月 05 週四 201110:22
  • DNS :rndc: connect failed: 127.0.0.1#953: connection refused

當重新啟動DNS時會發生rndc: connect failed: 127.0.0.1#953: connection refused 錯誤訊息,解決方式
1.重新產生檔案
$rndc-confgen > /etc/rndc.conf
如下
# key "rndc-key" {
#       algorithm hmac-md5;
#       secret "ozs3jAYNxzKNPmy4GJFqKA==";
# };


2.把上面這段取代掉/etc/bind/rndc.key理面的key "rndc-key"的內容,以前的註解掉
$vim /etc/bind/rndc.key

#key "rndc-key" {
#       algorithm hmac-md5;
#       secret "Ed3VmzsCSMSGLJts09IxEw==";
#};
#=======把上面以前的註解掉===========
key "rndc-key" {
      algorithm hmac-md5;
      secret "ozs3jAYNxzKNPmy4GJFqKA==";
};
#==========用上面這段取代===========

3.重新啟動DNS
$/etc/init.d/bind9 restart

另一個方式
1.查看DNS配置問題,用下面的指令查看
$named -g
/etc/bind/rndc.key: permission denied

$chmod 644 /etc/bind/rcnd.key
$named -g
OK



(繼續閱讀...)
文章標籤

蒼穹 發表在 痞客邦 留言(0) 人氣(3,738)

  • 個人分類:Server Edition
▲top
  • 5月 04 週三 201116:29
  • Ubuntu 阻擋暴力sshd的攻擊

當你的Ubuntu運行一段時間,記得要去查看 /var/log/auth.log,包準你嚇一跳一堆攻擊sshd的訊息出現,如何阻擋呢??來看一下吧
請安裝denyhosts套件,它會自行分析,並將攻擊IP寫入hosts.deny內

1.安裝denyhosts
#apt-get install denyhosts

2.啟動
#/etc/init.d/denyhosts restart

可以查看設定檔
vim /etc/denyhosts.conf

(繼續閱讀...)
文章標籤

蒼穹 發表在 痞客邦 留言(1) 人氣(458)

  • 個人分類:Server Edition
▲top
  • 5月 04 週三 201111:56
  • Ubuntu 自動備份機制

有時候我們會備份相關資料如/etc資料夾 or 網站資料 or 資料庫,這時可以使用 tar+ logrotate 加入排程讓系統備份7天的資料

1.排程備份/etc資料夾 and /var/www資料夾,壓縮後放到/backup 資料夾內
#crontab -e
0 1 * * * tar zcvf /backup/etc.tar.gz /etc/ > /dev/null 2>&1
0 1 * * * tar zcvf /backup/www.tar.gz /var/www/ > /dev/null 2>&1

2.建議規則檔案,備份七天檔案並循環
#vim /etc/backup.conf
/backup/*gz {
missingok
notifempty
sharedscripts
postrotate
endscript
rotate 7
}

3.加入排程自動做
#crontab -e
58 0 * * * logrotate -f /etc/backup.conf > /dev/null 2>&1

4.完成。記得去/backup/檢查看看

 

(繼續閱讀...)
文章標籤

蒼穹 發表在 痞客邦 留言(0) 人氣(2,493)

  • 個人分類:Server Edition
▲top
12...9»

文章搜尋

熱門文章

  • ()Cwrsync for Windows 教學(不需密碼
  • ()開啟簡體程式的兩種方式
  • ()Squid Proxy for windows
  • ()今天是一年的第幾週
  • ()WindowsXP 靜態路由設定
  • ()Ubuntu Server 安裝 Postfix pop3 imap
  • ()Ubuntu啟用遠端桌面
  • ()Ubuntu Server 安裝 Phpmyadmin
  • ()Ubuntu Server變更語系(中文英文)
  • ()Ubuntu10 Iptables 防火牆NATport forward

文章分類

toggle 免費軟體 (3)
  • 備份軟體 (2)
  • Proxy Server (1)
  • 分析報表軟體 (2)
toggle 微軟系列 (1)
  • Office專區 (4)
toggle Solaris (2)
  • Solaris10網路設定 (13)
  • Solaris10 指令 (3)
toggle 網路相關 (1)
  • 免費軟體 (3)
toggle Other (1)
  • 情感抒發 (0)
toggle Microsoft (1)
  • WinXP (4)
toggle Ubuntu10.04 (2)
  • Server Edition (48)
  • Desktop Edition (2)
toggle CenOS (1)
  • 系統 (5)
toggle Feroda (1)
  • 系統 (1)
  • 未分類文章 (1)

最新文章

    文章精選

    參觀人氣

    • 本日人氣:
    • 累積人氣: