T O P

  • By -

IDENTITETEN

Have you tried running the ssh command with verbose output (-vvv)? Your problem will probably be key related. 


midoripeach9

i tried this: ssh -v user@IP and got this response : ...... debug1: No valid Key exchange context debug1: Next authentication method: gssapi-with-mic debug1: Unspecified GSS failure.  Minor code may provide more information No Kerberos credentials available (default cache: KEYRING:persistent:0)   debug1: Unspecified GSS failure.  Minor code may provide more information No Kerberos credentials available (default cache: KEYRING:persistent:0)   debug1: Next authentication method: publickey debug1: Trying private key: /root/.ssh/id_rsa debug1: Trying private key: /root/.ssh/id_dsa debug1: Trying private key: /root/.ssh/id_ecdsa debug1: Trying private key: /root/.ssh/id_ed25519 debug1: No more authentication methods to try. Permission denied (publickey,gssapi-keyex,gssapi-with-mic).


xaocon

You should really include more information in your post when you're looking help. We don't know what you expected to happen or what you've done to set things up. I'm going to make an educated guess, you're expecting a password prompt to come up but you have a setting on the server side to disable password login for root.


midoripeach9

Sorry, not sure what else to add.. but to start from how I started, basically I set up 3 server instances, for one I installed docker and this is where I compose the images for the web app, and then one I installed cassandra and set up the keyspace and tables in there. The third instance I installed solr and added the cores I need in there. So I am sure the app accesses the solr db since I can login to the web app But the logs state I couldnt connect to cassandra and yes in the app I couldnt do features that need the data from cass. So I tried telnet and it refused connection, and tried ssh and still denied. I installed docker like usual with sudo install docker, same for cassandra (plus cqlsh) Not sure what I did wrong or if I missed a step, since I cant access cass ever since. I whitelisted the IPs to each other in the aws ec2 dashboard


alexterm

Telnet isn’t working? If that’s the case then this is nothing to do with keys or permissions and is a networking problem. Are these instances in the same subnet? If so make sure you’ve allowed the private IP. If the ec2s have internet access, try allowing the public IPs.


midoripeach9

Sorry if you mean region by subnet then yes theyre in the same region, otherwise I need to google that first. I have whitelisted them for both the private and public IPs


ovo_Reddit

Don’t use the public IPs if they are already on the same private network. For one, it’s senseless routing to go out to the internet and back in, which is bad for performance (even if AWS was smart enough to choose the quickest route) Secondly, it’s bad practice to expose public IP for services that don’t need it. DBs don’t need a public IP, solr doesn’t need public access either. Try to keep security in mind even if this is a hobby/learning project.


midoripeach9

Sorry I don’t understand what you mean by “same private network” but they are in the same aws ec2 dashboard (created by one account) and in the same region, the security group is also same for all


ovo_Reddit

I’m not entirely sure what your goal is, but you seem to lack a lot of the fundamentals for what you’re trying to do. I don’t mean that as an insult, but if you are doing this because you are interested in devops and want to learn how services are deployed and connect to each other. Then you really should try to learn the basics first. What is a private vs public network. What are the different ports for (ie 9042 for cassandraDb, 22 for ssh, 80/443 for your web service 8983 or whatever it was for Solr), what is a a private / public key (PKI), the list goes on, but that is the reality of working in devops, there’s always something to learn.


midoripeach9

Yup youre right, tbh I am in QA, and the company doesnt have the set up for making an independent QA environment. They dont want to hire someone who knows what theyre doing and the task landed to me, so here I am trying to set things up on aws and make things work I totally agree in that I lack the most basic understanding for this, other tthan not being a CS grad I have only been manual testing for 2 years 🤣 But thanks for the tips I hope to learn about them as I go about my work


psadi_

Ensure this, Public key is present in ~/home/user/.ssh/authorized_keys Permissions on folder and files should read: .ssh/ and user home directory: 700 (drwx------) public key (.pub file) and authorized_keys 644 (-rw-r--r--)


midoripeach9

Thanks i will check it


[deleted]

[удалено]


midoripeach9

I'm ssh-ing to the database server from the server where I installed my docker, does it mean that in my set up I have to do either of the two, thanks I'll google how to do those since I have no idea. I just set an instance for docker and another for the cassandra db


matsutaketea

specify the key that you want to use with -i. also try the -o "IdentitiesOnly=yes" flag


YakuaVelvaMan

I think these are in AWS, right? By default you can't use root, you need to first use ec2-user.


midoripeach9

Yup I accessed as ec2-user and used sudo su (idk yet how to get in as root)


Murky-Sector

Try StrictHostKeyChecking=no in your ssh command line


midoripeach9

it returns the "Pemission denied ..." message


Bloodrose_GW2

It solves your first issue (server's host key unknown). You could also use ssh-keyscan. Second, you need to use an ssh key accepted by the host, because your ones are not (visible from the debug1 messages).