I'm trying to test my honeypot but for some reason I'm getting this message:
ssh root@server 10.0.2.15
ssh: Could not resolve hostname server: Name or service not known
What I'm doing wrong?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityTo connect to an ssh server in a terminal you need:
ssh
to start the programroot
@
sign separating the user name from the server identification10.0.2.15
Assembled, the command looks like:
ssh root@10.0.2.15
in general terms, ssh user@server
.
Alternatively, you can use the -l
option to directly specify the login name and skip the @
syntax:
ssh 10.0.2.15 -l root
As WooJoo stated, you need to tell it a valid server to connect to. If you wanted to use the form $ ssh root@server
you can, but you would need to have server
as an entry in /etc/hosts
or your dns server (which is not the case or you would not have had an error), or an entry in a file called config
located typically at /home/username/.ssh/config
.
A sample /etc/hosts entry would look like:
# Sample /etc/hosts file
127.0.0.1 localhost
127.0.1.1 computerhostnamehere
10.0.2.15 server
and a sample /home/username/.ssh/config could be as simple as:
Host server
HostName 10.0.2.15
User root
This would get you the basic functionality you are looking for. There are many more options available for placing in the ~/.ssh/config
file.
See man ssh
for more options :)
Please try by adding server entry to which you are trying to ssh in /etc/hosts file of machine from where you want to do ssh
ssh-copy-id user@host && chmod 0755 /root (if root user) or chmod 0755 /home/username
ssh root@10.0.2.15