用Ubuntu遠程登錄虛擬host時出現:
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
解決:
sudo dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl
(此方法沒試過。)
cmd='/usr/sbin/sshd',opts='-D'
host.cmd(cmd+' '+opts+'&')
意爲在新建的虛擬Host的終端裏執行/usr/sbin/sshd -D&,其中sshd -D&爲啓動sshd並作爲一個非守護進程在後臺運行。