Mặc dù hướng dẫn đã có tại http://buffalo.nas-central.org/wiki/Open_Stock_Firmware_LS-VL
nhưng để thực hiện thành công cần lưu ý:
+ Java
cd \
cd C:\Program Files (x86)\Java\jre7\bin
+ Thực hiện acp_commander. Gia thiet IP la 192.168.1.14. Chu y lenh sau tuy chon -c phai nam trong "..." chu khong phai '...'
Kiem tra output co thay 2 file
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "ls -l /mnt/disk1/share/"
Thuc hien script
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "sh -x /mnt/disk1/share/open-ls.txt"
Vi ly do nao do script khong thuc hien dc => copy sshd_config sang share => chmod 666 de kiem tra, chinh sua ==> copy back to /etc => chmod 600
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "cp /etc/sshd_config /mnt/disk1/share/"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 666 /mnt/disk1/share/sshd_config"
Chinh sua PermitRootLogin to "yes" va PermitEmptyPasswords yes
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 600 /mnt/disk1/share/sshd_config"
test OK
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "cp /mnt/disk1/share/sshd_config /etc/"
verify ok
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "grep PermitRootLogin /etc/sshd_config"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 600 /etc/sshd_config"
Restart sshd
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "/etc/init.d/sshd.sh restart"
Neu ko dc, thuc hien script thu cong
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "ls -l /root"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "ls -l /root/.ssh"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "cp /mnt/disk1/share/authorized_keys /root/.ssh/"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "mkdir /root/.ssh"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 700 /root/.ssh"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "cp /mnt/disk1/share/authorized_keys /root/.ssh/"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 600 /root/.ssh/authorized_keys"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "dos2unix /root/.ssh/authorized_keys"
Note: doi voi LS-VL neu dung fw 1.65mod1/1a/1b thi khong mo san ssh ma chi mo san telnet
Không có nhận xét nào:
Đăng nhận xét