Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to connect to the VM using the private key only (password doesnt work) #30

Closed
elieyal opened this issue Nov 21, 2016 · 3 comments
Closed

Comments

@elieyal
Copy link

elieyal commented Nov 21, 2016

Hi,
I'm new to all of this so i'm trying to learn and figure out a lot of things. I have used the command:
"vagrant init Sliim/kali-linux-2.0-amd64; vagrant up --provider virtualbox" to bring up the VM. it worked fine but I got an error trying to do the SSH for verifiying:
C:\vagrant>vagrant up kali
Bringing machine 'kali' up with 'virtualbox' provider...
==> kali: Box 'Sliim/kali-linux-2.0-amd64' could not be found. Attempting to fi
d and install...
kali: Box Provider: virtualbox
kali: Box Version: >= 0
==> kali: Loading metadata for box 'Sliim/kali-linux-2.0-amd64'
kali: URL: https://atlas.hashicorp.com/Sliim/kali-linux-2.0-amd64
==> kali: Adding box 'Sliim/kali-linux-2.0-amd64' (v2.0) for provider: virtualb
x
kali: Downloading: https://atlas.hashicorp.com/Sliim/boxes/kali-linux-2.0-a
d64/versions/2.0/providers/virtualbox.box
kali: Progress: 100% (Rate: 9255k/s, Estimated time remaining: --:--:--)
==> kali: Successfully added box 'Sliim/kali-linux-2.0-amd64' (v2.0) for 'virtu
lbox'!
==> kali: Importing base box 'Sliim/kali-linux-2.0-amd64'...
==> kali: Matching MAC address for NAT networking...
==> kali: Checking if box 'Sliim/kali-linux-2.0-amd64' is up to date...
==> kali: Setting the name of the VM: vagrant_kali_1479656317418_68770
==> kali: Clearing any previously set network interfaces...
==> kali: Preparing network interfaces based on configuration...
kali: Adapter 1: nat
==> kali: Forwarding ports...
kali: 22 (guest) => 2222 (host) (adapter 1)
==> kali: Booting VM...
==> kali: Waiting for machine to boot. This may take a few minutes...
kali: SSH address: 127.0.0.1:2222
kali: SSH username: vagrant
kali: SSH auth method: private key
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
kali: Warning: Authentication failure. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

after this I can do "vagrant ssh" to the VM but I get a request for password (for vagrant user I guess).
i have tired to use the "toor" password and i have tried to do SHS directly with root but nothing is working.
I have the private key from here:
https://github.com/Sliim/pentest-env/blob/master/ssh-keys/pentest-env
but I have no idea how to use it, can someone help me with understanding how can I make vagrant use the ssh key? where to put it and make vagrant use it correctly?

@Sliim
Copy link
Owner

Sliim commented Nov 22, 2016

Hi!

You should use vagrant up inside pentest-env repo instead of vagrant init.
Kali box require specific vagrant config to work properly. You can see configuration here.

The login is root and password toor, to use the private key run:
ssh -i /path/to/key root@<kali-ip>
But we can continue to debug your problem in #29 to run properly vagrant up inside pentest-env.

P.S. The Kali 2.0 box is very old, it's preferable you use the Kali rolling release such as 2016.2 ;)

@Sliim Sliim closed this as completed Dec 13, 2016
@riturajb
Copy link

What is the private key for the image at -
https://app.vagrantup.com/Sliim/boxes/kali-linux-2.0-amd64/versions/2.0.1

@Sliim
Copy link
Owner

Sliim commented Oct 12, 2017

https://github.com/Sliim/pentest-env/blob/master/ssh-keys/pentest-env

Note: you are using an old box!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants