顯示具有 ssh 標籤的文章。 顯示所有文章
顯示具有 ssh 標籤的文章。 顯示所有文章

2013-04-13

CODE - 執行 php 出現的 Host key verification failed. 255 / Host key verification failed

php code
$cmd = '/usr/bin/ssh root@x.x.x.x cat /home/logs/consumer.log 2>&1';
$last_line = system($cmd, $retval);
echo json_encode($retval).' / '.$last_line;

會顯示
Host key verification failed. 255 / Host key verification failed.
(或用 exec , retval 是 255 的情況)

解決方法 :
由執行 php code 的機器(這裡是 stage), 用 wwwrun 的身份去 ssh 該主機, 按 yes 即可
大概是因為 vm clone 好後, 雖 stage 的 public key 已加在該主機的 authorized_keys2 裡,
但實際上卻未曾連過, 只要連過 public key 便可在 authorized_keys2 裡生效

2013-01-21

TOOL - ssh 或 http 連進 VirtualBox 的 server 裡

很久以前記的, 把它貼上來

1. 打開cmd,然後輸入下列指令
VBoxManage setextradata win2ks "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/Protocol" TCP
VBoxManage setextradata win2ks "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/GuestPort" 8080
VBoxManage setextradata win2ks "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/HostPort" 8080
2. 重開 Virtualbox

ref :
http://dev.sopili.net/2009/05/connect-ssh-http-into-virtualbox.html
http://www.arthurtoday.com/2009/11/virtualbox-port-forwarding.html#.UP46QqHF1WQ

2012-07-17

2012-03-03

LINUX - ssh 連線後的 can't set the locale... 錯誤

ssh 連線後顯示 can't set the locale; make sure $LC_* and $LANG are correct
原本想不理它, 但好像會導致某些操作或指怪怪的....
解法如下 :