I've Virtual Machine running in Google Compute. I've Ubuntu 14.04 on that VM.
I'm building a AOSP custom ROM on this VM. I needed to open port 8072 and 8073 for new toolchain (for Marshmallow) to start the server. So I followed following steps: 1. ufw was inactive; so I enabled it 2. sudo allow tcp:8072 3. sudo allow tcp:8073 4. sudo ufw status verbose
It showed these 2 ports there.
After some time I restarted the VM; and now I'm not able to connect to it.
I connect using the option "Open in browser window". I also tried with "Open in browser window with custom port" with port 22. But it is not allowing me to connect to it.
Can someone help me with this?
答案 0 :(得分:1)
问题在于,当你允许ufw它阻止了新的ssh连接时,你需要从旧实例和/mnt/etc/ufw.conf启动另一个实例,并设置ENABLE = no。 / p>
data: 0x20010312D14020010000210100002201000023010000
binary sum: 1 1101 0001 (0x1D1)
last byte: 1101 1110 (0xD1)
invert: 0010 1110 (0x2E)
add 1: 0010 1111 (0x2F)
use only last byte of calculated CS
CS: 0x2F
# Set to yes to start on boot. If setting this remotely, be sure to add a rule
# to allow your remote connection before starting ufw. Eg: 'ufw allow 22/tcp'
之后,使用旧磁盘重新启动实例,您需要添加的第一条规则是 ufw allow 22 / tcp 。
但您需要允许Google云防火墙上的端口8072和8073允许连接到该实例。
答案 1 :(得分:0)
您可以创建另一个实例,因为该实例正在使用该磁盘。
如果您在磁盘上有重要信息,请在继续之前执行快照
1 - 编辑实例并确保"删除实例时删除启动盘"未经检查。
2 - 删除实例。 (现在您有一个未被任何实例使用的磁盘)
3 - 将olddisk添加到另一个实例(不是根磁盘)
4 - 编辑您正在运行的另一个实例,并将旧磁盘添加到其中。
5 - 装入旧磁盘。 (mount / dev / sdb1 / mnt)
6 - 编辑/etc/ufw/ufw.conf
7 - 卸载磁盘(umount / mnt)
8 - 编辑您装入磁盘的实例并从实例中删除磁盘。
9 - 返回磁盘选项卡,单击旧磁盘并创建实例。