You set the networking adapter into bridged mode (virtual box settings). That's all.
If you want to be able to access your development server from the production server, you need to port-forward port 22 to your development computer/virtal box IP.
To access the file system on the production server, you can use scp to copy files back and forth. I wouldn't recommend it however, it's a pain in the ass.
I would recommend you sshfs.
The way sshfs works is, it mounts the remote file system in your local filesystem.
Then you just open, edit, save, copy/paste files there, and sshfs does the scp data-transmitting stuff in the background.
Command:
sshfs theUserYouWantToLoginAs@ip.of.target.computer:/ /path/to/folder/where/you/want/to/mount/the/remote/filesystem
example:
sshfs root@74.125.77.99:/ /mnt/sshfs
PS: I would use ssh keys, not a password. Passwords are too weak.
To generate a key:
ssh-keygen -t rsa -b 4096
This generates id_rsa and id_rsa.pub
id_rsa.pub you echo into the authorized_keys file in the .ssh folder in the home directory of the ssh user on the target machine
example:
copy id_rsa.pub file to the target computer
cat ./id_rsa.pub >> /root/.ssh/authorized_keys
what happens if I need to pull files from the production server onto the development (VB) server? – None – 2011-01-11T15:42:35.443
I would mount the production server's file system as ssh file system. – Quandary – 2011-01-11T21:27:20.040
Note that you can omit user@ from user@ip if the user on the target machine corresponds to the user you're currently logged in with on the development machine. – Quandary – 2011-01-11T21:37:43.170
Maybe I should explain a bit more. – None – 2011-01-11T23:38:38.690
I tried the bridge route but I just got
ssh: connection to host xxx.xxx.xxx.xxx port 22: Network unreachable
. My setup is:router: 192.168.1.1 - host: 192.168.1.4 - guest: 192.168.1.5 (vb/dev)
and I let through 22 for 192.168.1.5 on my router. What I find weird about all of this is I can still ssh from the host machine(192.168.1.4)
to the production server – None – 2011-01-11T23:44:05.760thanks for the
sshfs
andkeys
info. But for now I would just be happy to get ssh working – None – 2011-01-11T23:48:47.837Another thing to note is that I could do this all fine at work with a
nat
connection. So I think it's router related – None – 2011-01-11T23:56:00.867Did you switch off all firewalls ? (Windows firewall + iptables) – Quandary – 2011-01-13T08:19:10.410