user@hostname:directory $or#
->
root@rhel7:/lib/systemd/system#
[lawrence@rhel7 tmp]$
#yum install tigervnc*
以某個user來執行vncserver之後,在user家目錄中有這個/.vnc/xstartup檔案就可以了,當然passwd也是會一起產生的。以上與CentOS6/RHEL6無異。
開啟/lib/systemd/system/vncserver@.service用root啟動vncserver不是一個好習慣.....
修改[service]這個field如下:
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver"
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill > /dev/null 2>&1 || :'
修改unit(service)的configuration後,必需讓systemd知道,所以我要執行 systemctl daemon-reload昭告天下。
systemctl start vncserver@multi-user6. 開機啟動vncserver:
systemctl enable vncserver@multi-user
$CFG['Sources']['Source2']['LogLineType'] = 'syslog23';
Step1. Install XQartz(X11) for OSX 10.6 or later (http://xquartz.macosforge.org/landing/)
Step2. Logout and login OSX by Admin account.
Step3. Install Wireshark for OSX 10.6 and later Intel 64 bit (http://www.wireshark.org/download.html)
Step4. Launch Wireshark and chose XQartz as X11 environment.
Step5. Turn on monitor mode -> http://ask.wireshark.org/questions/26270/how-to-turn-on-monitor-mode-on-mac-osx-1075
Step1. sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
Step2. sudo airport -z #disassociates you card from the current network
Step3. sudo airport --channel= ["channel you want to switch to"] #sets the channel the card monitors on
先確定mibs的目錄:
[root@localhost ~]# net-snmp-config --default-mibdirs
/root/.snmp/mibs:/usr/share/snmp/mibs
可以看到我的mibs可以放在/root/.snmp/mibs or /usr/share/snmp/mibs,在此我選擇放在/usr/share/snmp/mibs。
開啟並編輯[root@localhost mibs]# vi /etc/snmp/snmptrapd.conf 如下:
#SNMP v2 with community as public
disableAuthorization no
authCommunity log,execute,net public
# SNMP v3 with user as admin and passphase as aaaaaaaa
createUser admin MD5 aaaaaaaa DES aaaaaaaa
authUser log,execute,net admin
[root@localhost mibs]# snmptrapd -m all -c /etc/snmp/snmptrapd.conf -Lo -f
NET-SNMP version 5.3.2.2
-m all -> 讀入所有的mibs files
-c -> 預設的configuration file
-Lo -> 輸出到基本output
-f -> do not fork from the shell
這邊你會看到snmp trap event會輸出至螢幕,方便debug用。
[root@localhost mibs]# /etc/init.d/snmptrapd start
正在啟動 snmptrapd: [ 確定 ]
而這裡你將會看到snmp trap event會被寫入到/var/log/messages。
Open and edit /etc/raddb/radiusd.conf to set:
log_auth = yes
auth_log
detail auth_log {
detailfile = ${radacctdir}/%{Client-IP-Address}/auth-detail-%Y%m%d
#
# This MUST be 0600, otherwise anyone can read
# the users passwords!
detailperm = 0600
}
Open and edit /etc/raddb/radiusd.conf to set:
auth = yes
Open and edit /etc/raddb/sites-available/default to set:
auth_log
# iptables -t nat -A PREROUTING -i eth0 -p gre -j DNAT --to-destination 10.10.2.186
Where 10.10.2.186 is GRE GW2's IP.
# modprobe ip_gre
# ip link add link gre0 name tunnel0 type gretap remote 192.168.0.1 local 10.10.2.186
# ip link set tunnel0 up
# brctl addbr br0
# ip link set br0 up
# ip link set eth2 up
# brctl addif br0 tunnel0
# brctl addif br0 eth2
# export http_proxy="http://10.10.10.254:8080"
# export https_proxy="https://10.10.10.254:8080"
# unset http_proxy
# unset https_proxy
wget ftp://ftp.muug.mb.ca/mirror/redhat/contrib/libc6/i386/tac_plus-4.0.3-2.i386.rpm
rpm -ivh tac_plus-4.0.3-2.i386.rpm
vi /etc/tacacs/tac_plus.cfg
# Created by Devrim SERAL(devrim@tef.gazi.edu.tr)
# It's very simple configuration file
# Please read user_guide and tacacs+ FAQ to more information to do more
# complex tacacs+ configuration files.
#
# Put your NAS key below
key = "testing123"
# Use /etc/passwd.loc file to do authentication
# it's must be in passwd file format. So you must mix shadow-passwd files to do it
#default authentication = file /etc/passwd.loc
user = lawrence { login = cleartext 123456}
# Where is the accounting records to go
accounting file = /var/log/tacacs.log
# Permit all authorization request
default authorization = permit
# End config file
# The user lawrence with password 123456 will be created.
[root@server1 tmp]# /etc/init.d/tacacs start
Starting tacacs+:
[root@server1 tmp]# netstat -tupln | grep 49
tcp 0 0 0.0.0.0:49 0.0.0.0:* LISTEN 9027/tac_plus
[root@server1 raddb]# netstat -tupln | grep 1812
udp 0 0 0.0.0.0:1812 0.0.0.0:* 7300/radiusd
[root@server1 raddb]# netstat -tupln | grep 1813
udp 0 0 0.0.0.0:1813 0.0.0.0:* 7300/radiusd
[root@server1 raddb]# netstat -tupln | grep 1814
[root@server1 raddb]# netstat -tupln | grep 1815
listen {
ipaddr = *
port=1814
type=auth
}
listen {
ipaddr = *
port=1815
type=acct
}
[root@server1 raddb]# /etc/init.d/radiusd restart
正在停止 RADIUS 伺服器: [ 確定 ]
正在啟動 RADIUS 伺服器: Thu Feb 7 13:31:06 2013 : Info: Starting - reading configuration files ...
[ 確定 ]
[root@server1 raddb]# netstat -tupln | grep 1812
udp 0 0 0.0.0.0:1812 0.0.0.0:* 7347/radiusd
[root@server1 raddb]# netstat -tupln | grep 1813
udp 0 0 0.0.0.0:1813 0.0.0.0:* 7347/radiusd
[root@server1 raddb]# netstat -tupln | grep 1814
udp 0 0 0.0.0.0:1814 0.0.0.0:* 7347/radiusd
[root@server1 raddb]# netstat -tupln | grep 1815
udp 0 0 0.0.0.0:1815 0.0.0.0:* 7347/radiusd
networksetup -setv6off Ethernet
networksetup -setv6off Wi-Fi
mDNS -B(Browse for services instances)
MBP:~ lawrence$ mDNS -B _sftp-ssh._tcp.
Browsing for _sftp-ssh._tcp.
Talking to DNS SD Daemon at Mach port 5891
Timestamp A/R Flags Domain Service Type Instance Name
12:18:11.060 Add 0 local. _sftp-ssh._tcp. MBP
mDNS -L(Look up a service instance)
MBP:~ lawrence$ mDNS -L "MBP" _sftp-ssh._tcp. .
Lookup MBP._sftp-ssh._tcp.local
Talking to DNS SD Daemon at Mach port 5891
12:18:54.882 Service can be reached at 10.10.2.7 :22
12:18:54.882 FE80:0000:0000:0000:3E07:54FF:FE35:5093%en0:22
12:18:54.883 3001:0288:0000:0000:3E07:54FF:FE35:5093%en0:22
1. dhcpd的lease table是放在/var/lib/dhcpd/dhcpd.leases
lease 10.10.6.125 {
starts 2 2012/10/16 22:12:53;
ends 3 2012/10/17 22:12:53;
tstp 3 2012/10/17 22:12:53;
binding state active;
next binding state free;
hardware ethernet b8:ac:6f:21:53:ec;
uid "\001\270\254o!S\354";
client-hostname "D129252S";
}
10.10.6這個range被fake DHCP client用完了,所以我要把它們手動通通砍掉。
sed -i "/10.10.6/,/}/d" /var/lib/dhcpd/dhcpd.leases
# /etc/init.d/dhcpd restart
# yum install httpd rrdtool rrdtool-perl perl-libwww-perl perl-MailTools perl-MIME-Lite perl-CGI perl-DBI perl-XML-Simple
# rpm -ivh http://www.monitorix.org/monitorix-n.n.n-1.noarch.rpm
(where n.n.n is the latest version,2.6.0 for example)
Configure file is in /etc/monitorix.conf
Apache configure file is in /etc/httpd/conf.d/monitorix.conf, and you need to configure it allow connect to Monitorix from any where.
# /etc/init.d/monitorix start && chkconfig monitorix on
# /etc/init.d/httpd restart && chkconfig httpd on