Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Brand new Ubuntu LTS 10.04.2 install (and updated), with sshd running. I added a host-only adapter. And configured it like this:

auto eth1
iface eth1 inet dhcp

I can ssh from the guest to itself over eth1's ip address.

I cannot ssh from the host to the guest over that same IP address:

$ ssh 192.168.56.102
ssh: connect to host 192.168.56.102 port 22: Permission denied

From the Host:

$ ifconfig vboxnet0
vboxnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 0a:00:27:00:00:00 
inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56.255

Fromt the guest:

eth0      Link encap:Ethernet  HWaddr 08:00:27:2b:8d:34  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe2b:8d34/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17 errors:0 dropped:0 overruns:0 frame:0
          TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2697 (2.6 KB)  TX bytes:2378 (2.3 KB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:e8:60:0e  
          inet addr:192.168.56.102  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fee8:600e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1180 (1.1 KB)  TX bytes:1152 (1.1 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
share|improve this question
    
Try changing the host adapter to bridged. –  Joe Internet May 16 '11 at 19:27
    
bridged networking works. But I want a static IP address that won't change based on the network I'm connected to. –  crankharder May 16 '11 at 22:58
    
Ok, I tested it on Win7/Mint, and had no problems connecting over either adapter. Take a look in the /etc/ssh/ssd_config file and make sure that it's not excluding the eth1 address. Also check any firewall settings to see if the address is being blocked. –  Joe Internet May 18 '11 at 2:41
    
Have you tried to use "Bridged Networking" instead of host-only-adapter? –  Leon Meier May 5 at 10:16
    
have you tried checking if your firewall is configured to block requests over port 22? –  user1301428 May 5 at 11:13

2 Answers 2

In my case the permission denied was caused by Cisco Any Connect VPN software that was running wild. After quiting it the connection to vboxnet worked as expected.

share|improve this answer
    
I had this same problem on my Mac. Would have never suspected it. Thanks!!! –  cdn Aug 27 at 20:39

I think you are confusing bridged with dhcp/static addressing. A bridged network interface means that the guest will be visible on the network as if it were a physical machine.

DHCP/static simply means whether the guest will get its IP address automatically from the router (presumably) or not.

In your comment you say that bridged networking works but you only want a static IP. If this is so, put this in your /etc/network/interfaces:

iface eth1 inet static
address 192.168.1.102
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

If you still want to use a host-only adapter, have you tried checking if your firewall is configured to block requests over port 22?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.