ssh on virtual box (4.0.4)


 
Thread Tools Search this Thread
Special Forums IP Networking ssh on virtual box (4.0.4)
# 1  
Old 05-31-2012
ssh on virtual box (4.0.4)

Hello,

I have two virtual machines ubuntu on virtual box vm1 and vm2 , i'd like to use ssh to connect from vm1 to vm2, please what's the configuration should do?


Thank you
# 2  
Old 06-01-2012
Log onto both VMs as the user you want to ssh from / to.

On vm2 and then on vm1:
Code:
ssh-keygen

(press enter a few times)

While still on vm1:
Code:
scp ~user/.ssh/id_rsa.pub user@vm2:/home/user/.ssh/authorized_keys (you need to enter the password)
scp user@vm2:/home/user/.ssh/id_rsa.pub ~user/.ssh/authorized_keys

Change "user" to whatever the username should be.

If .ssh is already configured, then:
Code:
scp ~user/.ssh/id_rsa.pub user@vm2:/home/user/.ssh/key.vm1 (you need to enter the password)
scp user@vm2:/home/user/.ssh/id_rsa.pub ~user/.ssh/key.vm2
cat ~user/.ssh/key.vm1 >> ~user/.ssh/authorized_keys
ssh user@vm2 "cat /home/user/.ssh/key.vm2 >> /home/user/.ssh/authorized_keys"

First check that you can at least ping each VM from the other one.

Last edited by Scott; 07-23-2012 at 05:04 PM.. Reason: Changed first four "ssh" to "scp" ???
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Change hostID of Solaris 10 virtual/guest machine installed by Virtual Box 4.1.12 on Windows-XP host

Trying to set or modify the randomly set hostID of a Solaris 10 virtual/guest machine that I installed on a Windows-XP host machine (using Virtual Box 4.1.12). I was able to set/modify the hostname of the Solaris 10 virtual/guest machine during installation as well as via the Virtual Box... (4 Replies)
Discussion started by: Matt_VB
4 Replies

2. Red Hat

cannot ssh (use NFS) on RHEL box, but can mount external & ssh out of RHEL box

Ok, Im trying to get NFS working on my RHEL 5 box, apparently i can use the box as a client, but not as a server. If it helps i cant ssh into the box (server), but as a client ssh works fine. Ive configured server: /etc/hosts.allow: all : all all :all@all setup my /etc/exports file... (4 Replies)
Discussion started by: drs.grid
4 Replies

3. UNIX for Dummies Questions & Answers

Sun Virtual box

hi Am Using Windows vista machine where i installed Sun Virtual Box on Which i installled Solaris 10.. am not able to ping my windows machine from Sun OS neither viceversa.. Can someone help me out to get this sorted please .... (2 Replies)
Discussion started by: Sojourner
2 Replies

4. Solaris

how to connect to wireless from virtual box

hi everyone... this is my first post here please help me with this..as iam new to solaris i have installed solaris 10 on virtual box.. and am not able to connect to the internet .. is there anyway i can get connect to the net.. please help me step by step if possible... thanks in... (1 Reply)
Discussion started by: yrajendergoud
1 Replies

5. Solaris

Help with mounting a folder-Virtual Box

How do you mount a shared folder within Solaris 10 virtual machine that has been shared by Virtual Box? (1 Reply)
Discussion started by: jastanle84
1 Replies

6. Windows & DOS: Issues & Discussions

Virtual Box

I am trying to create a new virtual machine (Red Hat) but I am getting the following error I am completely new to VB and I am probably missing something. Any help will be greatly appreciated. (4 Replies)
Discussion started by: Xterra
4 Replies

7. Ubuntu

ip on ubuntu installed using Virtual Box

Hi All I have few computers in the same network using a wifi router. In Each of them I installed VirtualBox and I created an image of Ubuntu 8.04 The thing is that each of those images has the same ip eth0=10.0.2.15. Do you know how can I make possible each virtual machine having another IP or... (2 Replies)
Discussion started by: manustone
2 Replies

8. Solaris

virtual box images

Does anyone know if you can use a virtual box image on different O/S's and be able to move it from one server to another of different O/S if needed? (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

9. Ubuntu

Virtual Box Screen Display

Hi, Anyone can help me on how to return back to normal size not the full size of my virtual box screen display and also display the menu bar from the top. Thanks in Advance. (4 Replies)
Discussion started by: dba_macau
4 Replies

10. UNIX for Advanced & Expert Users

Access files from prev box after SSH to another box

i'm not much of an advanced unix programmer but I'm trying to write a script to access files on box1 after ssh from box 1 to box2. when ssh is invoked in the script i'm getting logged into box2 and losing complete touch with box1 which is normal i guess. but my main aim with my script is when i... (3 Replies)
Discussion started by: pharos467
3 Replies
Login or Register to Ask a Question