Authentication error while performing a ssh connection on Tryhackme - ssh

I have been searching for this problem for so long, but I cant seem to get a positive result, I am new to pentesting and so I am doing some tasks on tryhackme for learning the basics of Linux and so when I try to connect to an ssh server :
ssh shiba1#10.8.150.23
The authenticity of host '10.8.150.23 (10.8.150.23)' can't be established.
ECDSA key fingerprint is
SHA256:5mSp6dwM2HeSewbWzIVJ2GV4bRUmbrdS0ZX8qMRPjfU.
Are you sure you want to continue connecting (yes/no /[fingerprint])? yes
Failed to add the host to the list of known hosts (/home/chota/.ssh/known_hosts).
shiba1#10.8.150.23's password:
Permission denied, please try again.
shiba1#10.8.150.23's password:
it gives me an authentication error(even though I am typing the correct password which is shiba1) btw this question is not a duplicate of ssh connection refused : tryhackme Learn Linux walkthrough
Any help would be appreciated
Btw, you can find the room at the following link:
https://tryhackme.com/room/zthlinux

it gives me an authentication error
Before that, it gives you an issue with /home/chota/.ssh/known_hosts.
I would start by checking the permissions of /home/chota/.ssh and known_hosts, to see why the ssh process is not able to modify that file.
Than I can check if the authentication error persists.

Related

SSH - what is the meaning of permission denied(publickey, password)?

sorry if the question may be vague or not but I noticed that whenever I have tried to login to a ssh server it usually says "permission denied(publickey, password" or "permission denied(publickey, password,x, y)" where x and y are other strings but do these indicate what I could use to login to the server or are these the requirements needed to login to the server?
It only lists the list of attempted authentication methods that failed at the initiation of the connection.
As described in this article from Marko Aleksic
One reason for the error may be sshd_config, the file that contains SSH server configuration.
The other possibility is that the authorized_keys file has insufficient permissions
if you have access to the server, stop the sshd service, and restart it manually in debug mode:
sudo /usr/sbin/sshd -d
That way, you will see exactly what is attempted and why it fails.

Host key verification failed on first ssh connection

I'm trying to log with ssh on my EC2 instance with a new dual-booted ubuntu 16.04. It's the first time i'm logging in with this client, so there is nothing in .ssh/known_hosts to be deleted, as it is suggested in many other posts like this one.
When I run :
ssh -i "my_key.pem" ubuntu#servername.amazonaws.com
I get:
The authenticity of host 'servername.amazonaws.com (serverip)' can't be established.
ECDSA key fingerprint is SHA256:***************************.
Are you sure you want to continue connecting (yes/no)?
Host key verification failed.
Since i can log with the exac same key from putty on my windows computer,and also from a mac with the same key, this doesnt seem to be key-related.
Anyone out there to help? Thanks in advance!
EDIT: i installed putty on linux, since it was working on windows. Doesnt work either.
nmap localhost gives me port 22 open.
nmap my.ip doesnt.
I tried to ssh to another address, and same results on ssh and putty :(
EDIT2: not a duplicate of BitBucket: Host key authentication failed
Problem solved: it was just me who only pressed Enter on "Are you sure you want to continue connecting (yes/no)?" and not typing yes. Thanks #Kenster
If you do not get any option to continue to connect and it fails permanently, then you could use the command with StrictHostKeyChecking=no option like following :
ssh -i "my_key.pem" ubuntu#servername.amazonaws.com -o StrictHostKeyChecking=no

SSH can't connect to Google Cloud

So, I just do trial GCloud service, and try connect via ssh. At the first time I forget my username of my Mac, so I did it wrong by doing this:
doe-MacBook-Pro:Documents does$ ssh -i ~/.ssh/google_compute_engine xxxx#111.111.111.111
Warning: Identity file /Users/does/.ssh/google_compute_engine not accessible: No such file or directory.
The authenticity of host '111.111.111.111 (111.111.111.111)' can't be established.
ECDSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added '111.111.111.111' (ECDSA) to the list of known hosts.
Permission denied (publickey).
then I know my username, I tried:
doe-MacBook-Pro:Documents does$ ssh -i ~/.ssh/google_compute_engine does#111.111.111.111
Warning: Identity file /Users/does/.ssh/google_compute_engine not accessible: No such file or directory.
Permission denied (publickey).
and it gives me error. Can you tell me how can I solve this issue?
This has nothing to do with the ssh username.
Check two things first and we can go from there:
Permission: should be readable by you, i.e., at least 0400.
File: does it exist at all?
Problem SOLVED!
I forget didn't completed my gcloud compute ssh project-name command.
After I finished with the command, it creates file google_compute_engine.
Now I finally can connect to my Google Cloud via SSH.

Trying SSH into an Amazon EC2 instance(windows server2012) from windows 7 - permission denied

this is probably a simple stupidly question :)
I've created a new windows instance on Amazon EC2, and also downloaded the .pem file to SSH.
with cygwin
$ ssh -i mykey.pem Administrator#ec2-xx-xx-xx-xxx.us-west-2.compute.amazonaws.com
Administrator#ec2-xx-xx-xx-xxx.us-west-2.compute.amazonaws.com's password:
Permission denied, please try again.
permission set to 400 for mykey.pem file.
$ chmod 400 mykey.pem
I also tired with the putty by creating mykey.ppk file form mykey.pem with puttygen but getting access denied error :(
Using username "Administrator".
Authenticating with public key "imported-openssh-key"
Server refused public-key signature despite accepting key!
Administrator#ec2-xx-xx-xx-xxx.us-west-2.compute.amazonaws.com's password:
Access denied
dont know what kind of silly mistake im making here!
Please guys do u have any suggestion here?
Following are the most possible reasons-
Port 22 is not open while creating EC2 instance
Firewall configuration on your local machine(just try disconnecting VPN)
AWS account is suspended due to pending bill payment
SSH port on EC2 server were not open to incoming traffic.

not able to communicate with the client using ssh

I am trying to setup a Hadoop cluster but i am unable to access the slave machine using ssh, though i am able to ssh to the localhost.i have tried the passphraseless method.i am totally new to Hadoop and haven't used ssh before so not able to figure out my mistake.
Whenever i issue ssh for the client it asks me to enter the client machine's password.but as soon as i give the password i get the following line on the terminal -
"Permission denied, please try again"
Also when i try to copy the public key from the master to the slave i get the same message.
Need some help badly...
I had the same issue.
Please check if ssh server is running or not? If yes, open /etc/ssh/ssh_config and /etc/ssh/sshd_config file. Issue is server is running on different port and client is pointing to different port. Before this please ensure that openssh-server and client are installed.
Vivek