Cannot ssh guest OS from host
Hello everyone,
So I'm a Linux newbie. I'm trying to learn ssh ,ftp, telnet and other stuffs after introducing myself to some basic commands.But my problem is that i have only one laptop , so i decided to give a go to VirtualBox .Ok lets cut this crap and head to the main problem... Host = Ubuntu 11.04 Guest = Arch 2.6.33 VM= VirtualBox 4.0.10 I have installed openssh in both machines.I followed the this link http://www.wiredrevolution.com/virtu...-and-guest-vms So now this is what i can do, 1- I can ping and ssh from guest to host :) 2- I can ping guest from host but cannot ssh.(i need to mention that i used Quote:
Quote:
Do i need to change something in hosts.deny or hosts.allow in guest or host os(I think it's related to something tcp wrappers but i don't have any idea). I don't know what to do :| Any help will be appreciated TIA |
Is an ssh server running on the guest? do an 'ssh localhost' on it to see if that works first.
|
oops!
Quote:
How can i process now (Ok Gonna google it) Thanks for your reply |
Arch has an excellent wiki. Here is their SSH page: https://wiki.archlinux.org/index.php/Secure_Shell (you'll need just section 1 to get started).
|
I'm clueless
Quote:
|
Are you running the command as root user?
|
(removed; I'm stupid)
EDIT: Actually, maybe I can still help (:p): try just directly invoking the daemon script with /etc/rc.d/sshd start. rc.d, AFAIK, is mostly just a proxy/enhancement to that functionality. …and yes, make sure you're root as well. ;) EDIT++: pgrep sshd to see if it's already running. |
Quote:
Quote:
|
Quote:
but when i had tried Quote:
Quote:
BTW thanks for your response :) EDIT: So now i can access my guest OS using eth1 interface but when i try to access guest OS using ip of eth0 interface neither i can ping nor ssh.It means that it won't be accessible from internet (other than host OS and other guests). :confused: |
Quote:
Here's what I do if I want a virtual machine to be accessible through SSH while still having internet access: 1. Set up iptables/IP forwarding on the host: Code:
iptables -t nat -A POSTROUTING -o <host network interface> -j MASQUERADE 2. Set the default gateway/DNS nameservers on the guest: point the gateway to the IP of the host virtual network interface (typically vboxnet0), and set the DNS servers to be identical to those on the host. I usually stick these lines in /etc/rc.local (or whatever the equivalent init script is in whatever distro/OS it is that I'm messing with :p): Code:
echo "nameserver <ISP DNS server IP, or maybe router IP>" > /etc/resolv.conf EDIT: If you need more details on this, the Arch Wiki delivers. ;) Most of the information there should apply just as well to a "share" between a host and a VM as it does a network between two real machines. |
Hmmm gotta learn iptables next. Thanks for your replies and thread gets the solved prefix. ;-)
|
All times are GMT -5. The time now is 12:58 AM. |