2011年12月20日 星期二

QNAP TS-412 安裝 openssh

1.使用QPKG 外掛管理,安裝 Optware IPKG


2.安裝 openssh
ipkg update
ipkg install openssh

3.開機自動啟動 open sshd
修改 /etc/init.d/Optware.sh,尋找以下內容
case "$1" in
start)
...[elided]...
# adding Ipkg apps into system path ...
/bin/cat /etc/profile /bin/grep "PATH" /bin/grep "/opt/bin" 1>>/dev/null 2>>/dev/null
[ $? -ne 0 ] && /bin/echo "export PATH=$PATH":/opt/bin:/opt/sbin >> /etc/profile
;;
stop)

改為

case "$1" in
start)
...[elided]...
# adding Ipkg apps into system path ...
/bin/cat /etc/profile /bin/grep "PATH" /bin/grep "/opt/bin" 1>>/dev/null 2>>/dev/null
[ $? -ne 0 ] && /bin/echo "export PATH=$PATH":/opt/bin:/opt/sbin >> /etc/profile


# Patch per http://wiki.qnap.com/wiki/Install_Optware_IPKG
/bin/echo "Run Optware/ipkg /opt/etc/init.d/*"
source /etc/profile
# Start all init scripts in /opt/etc/init.d
# executing them in numerical order.
#
for i in /opt/etc/init.d/S??* ;do
# Ignore dangling symlinks (if any).
#[ ! -f "$i" ] && continue



case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set start
. $i
)
;;
*)
# No sh extension, so fork subprocess.
$i start
;;
esac
done
# End patch


;;
stop)

2011年11月16日 星期三

PXELinux 設定範例

/etc/xinetd.d/tftp
---------------------------------------------
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

/etc/dhcpd.conf
-------------------------------------------
ddns-update-style none;
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.56.0 netmask 255.255.255.0 {
range 192.168.56.10 192.168.56.20;
option broadcast-address 192.10.0.255;
option routers 192.168.56.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.19.10;
next-server 192.168.56.101;
filename "linux-install/gpxelinux.0";
}

/tftpboot/linux-install/pxelinux.cfg/default
--------------------------------------------
DEFAULT menu.c32
PROMPT 0
ALLOWOPTIONS 0
TIMEOUT 50

LABEL linux
MENU LABEL LINUX
KERNEL vmlinuz
append initrd=initrd.img


LABEL local
kernel chain.c32
append hd0 0


LABEL dos
MENU LABEL DOS
kernel memdisk
append initrd=dos.img


LABEL memtest
MENU LABEL MEMTEST
kernel memdisk
append iso initrd=memtest86+-4.20.iso

2011年11月3日 星期四

PROXMOX新增WEB帳號


1.ssh login
2.add user
3.add user group id 0

2011年10月25日 星期二

XP命令列批次刪除空目錄

for /f %a IN ('dir /a:d /b') do rd "%a"

2011年9月14日 星期三

開啟 ZyXEL NSA 221 Telnet

1.安裝套件 PHP-MySQL-phpMyAdmin

2.啟用Web發行功能,將 public加入

3.啟用套件 PHP-MySQL-phpMyAdmin

4.編輯共用 public 勾選 將此共享發行至 Web

5.連線共用磁碟 net use * \\<ip>\public
新增檔案 getpasswd.php 內容如下
<?php
echo '<pre>
login:NsaRescueAngel
password:';

system('/sbin/makekey');
echo '</pre>';
?>

6.下列網址開啟 telnet 後門,帳號為:NsaRescueAngel
http://<ip>/zyxel/cgi-bin/remote_help-cgi?type=backdoor

7.下列網址取得密碼
http://<ip>/public/getpasswd.php

2011年8月15日 星期一

QNAP TS-219P ssh 輸入中文

編輯 /etc/inputrc 新增以下內容

set convert-meta off

2011年8月4日 星期四

D-LINK dns-323 讓 lighttpd 在PORT 80執行

以下適用於 fun-plug 05,必須先完成安裝 fun-plug 05

ssh / telnet 登入dns-323 執行以下指令

1.修改 /ffp/etc/lighttpd.conf
#server.port = 8080
server.port = 80

2.關閉 系統 web 管理界面
sh /ffp/start/kickwebs.sh start

3.重新啟動 lighttpd
sh /ffp/start/lighttpd.sh restart

其他:
系統 web 管理界面一段時間會自行啟動埠改至 81