Sponsored Content
Full Discussion: ssh on virtual box (4.0.4)
Special Forums IP Networking ssh on virtual box (4.0.4) Post 302649733 by Scott on Friday 1st of June 2012 03:38:44 AM
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" ???
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
SSH-COPY-ID(1)						      General Commands Manual						    SSH-COPY-ID(1)

NAME
ssh-copy-id - install your public key in a remote machine's authorized_keys SYNOPSIS
ssh-copy-id [-i [identity_file]] [user@]machine DESCRIPTION
ssh-copy-id is a script that uses ssh to log into a remote machine (presumably using a login password, so password authentication should be enabled, unless you've done some clever use of multiple identities) It also changes the permissions of the remote user's home, ~/.ssh, and ~/.ssh/authorized_keys to remove group writability (which would oth- erwise prevent you from logging in, if the remote sshd has StrictModes set in its configuration). If the -i option is given then the identity file (defaults to ~/.ssh/id_rsa.pub) is used, regardless of whether there are any keys in your ssh-agent. Otherwise, if this: ssh-add -L provides any output, it uses that in preference to the identity file. If the -i option is used, or the ssh-add produced no output, then it uses the contents of the identity file. Once it has one or more fin- gerprints (by whatever means) it uses ssh to append them to ~/.ssh/authorized_keys on the remote machine (creating the file, and directory, if necessary) SEE ALSO
ssh(1), ssh-agent(1), sshd(8) OpenSSH 14 November 1999 SSH-COPY-ID(1)
All times are GMT -4. The time now is 06:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy