Permission denied (publickey,gssapi-keyex,gssapi-with-mic) on Mac - macos

I want to connect from my Mac (terminal) to GCP instance (centos) by running ssh -i new_ssh_key centos#0.0.0.0
and I got the error centos#0.0.0.0: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
All works well till yesterday when SCP command did not worked out so I changed the permissions and probably something went wrong and now I can not connect to centos server at all.
Appreciated any help on this.

I fixed with adding below lines in /etc/ssh/ssh_config
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
As shown:

Related

SSH to wpengine works in windows command terminal but not git bash

Recently I had to get my hard drive replaced on my work machine and thus had to reconfigure everything. As a result I had to reinstall git bash. Before I was able to ssh fine into wpengine and now I cannot.
I am able to connect via the regular windows terminal fine but when I try with git bash I am getting the "Permission denied (publickey)." error for the same exact command.
I have tried all the suggested options from wpengine and in the different questions related to this on other SE questions and nothing is working.
I am using a Windows machine on windows 10.
Here are the following things I have tried:
Regenerating the key and adding it to my user public keys again and
then waiting 24 hours.
Adding the config details to the ssh_config file in C:\Program
Files\Git\etc\ssh
Adding a config file to my /User/username/.ssh/ folder.
I have tried using the following link and adding the wpengine rsa file: https://gist.github.com/jherax/979d052ad5759845028e6742d4e2343b as well.
Any and all help would be appreciated.
My guess is there is some kind of permissions issue going on the local machine?
Why would the request from git bash terminal to wpengine look different from windows command terminal?
I did solve my issue. If it helps you please use it!
When I used the command to the ssh host with : ssh -v user#environment.wpengine.ssh.net info
I got back this among the debug errors:
debug1: Offering public key: /c/Users/USERNAME/.ssh/KEY_FILENAME RSA XXXXXXXXXXXXXXXXXXXXX explicit
debug1: send_pubkey_test: no mutual signature algorithm
debug1: No more authentication methods to try.
user#environment.ssh.wpengine.net: Permission denied (publickey).
After finding this page:
https://transang.me/ssh-handshake-is-rejected-with-no-mutual-signature-algorithm-error/
I was able to solve the issue by adding the line:
PubkeyAcceptedAlgorithms +ssh-rsa to my ssh config file.
Honestly I am not even 10% certain on WHY this worked, however, it solved my problem.
How To Connect with SSH In WPEngine
If you are having trouble connecting to SSH in WPEngine Following are the commands which I used:
ssh-keygen -t rsa -b 4096 -f c:/users//.ssh/wpengine_rsa
Add Fingerprint in WPEngine My Profile – SSH
Add Config file
Host *.ssh.wpengine.net
IdentityFile ~/.ssh/wpengine_rsa
IdentitiesOnly yes
Connect with your wordpress website (windows command prompt)
ssh environment#environment.ssh.wpengine.net

'mysql_upgrade' Access denied for user 'root'#'localhost' on M1 Mac

I followed the macos installation of MariDB on their website and I always get this error when I try to run mysql_upgrade
I also can't secure the installation due to the same error
Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
ERROR 1698 (28000): Access denied for user 'root'#'localhost'
FATAL ERROR: Upgrade failed
I tried following tutorials but they don't work.
What should I do?
EDIT
Sorry, I forgot I posted a question here.
It's all good now! I was able to make it work. All I did was use mariadb -u root -p instead, and the password was root.
The tutorial I used was the one from Mariadb's official website.
As for this solution, I forgot where I got it from but, kudos to you who helped me!
You haven't posted which tutorials you have followed.
Have you tried
mysql_upgrade -p
it will prompt for root password. You can even run it with a different user using the -u option.
Hope this helps.
FYI: https://mariadb.com/kb/en/mysql_upgrade/

"Bad configuration option: KexAlgorithms"

I am trying to ssh into a remote server for my university on a Windows 10 computer.
I installed OpenSSH. When I first tried to ssh in, I would get the error
no kex alg
Doing some googling, I put the following in my /.ssh/config file
KexAlgorithms kexalgorithms curve25519-sha256,curve25519-sha256#libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
However, now when I try to ssh, I get these errors:
/cygdrive/c/Users/name/.ssh/config: line 3: Bad configuration option: KexAlgorithms
/cygdrive/c/Users/name/.ssh/config: terminating, 1 bad configuration options
I'm new to trying this and have been frustrated for hours. Anyone know how I can fix this? Thank you :)
UPDATE: Changed my config file to this based off comment, still getting error:
Host name#remote_server
HostName name#remote_server
KexAlgorithms curve25519-sha256,curve25519-sha256#libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
Error message still the same, still getting error with line 3, KeyAlgorithmns
The binaries of ssh in windows 10 are outdated. You should download the new ssh binaries and add them to the windows environment variables and it's fixed. Stack overflow post

Public key error connecting to AWS EC2 Ubuntu instance on Mac with .pub file, username and host name

I am a newbie to AWS and need some help. I have a .pub file, a host name and username. I have been trying to connect to the server, but keep getting a Permission denied (publickey) error. Someone else set up the instance.
The .pub file is on my desktop. I am in desktop in my directory. Did chmod 400 to the .pub file. I then try:
ssh -i /Users/machine/Desktop/filename.pub ubuntu#placeholder.com
Please let me know if you have any suggestions.
Thanks!
You need the private key to connect to EC2.
ssh -i /path/my-key-pair.pem ec2-user#ec2-198-51-100-1.compute-1.amazonaws.com

Permission denied (publickey). Couldn't read packet: Connection reset by peer

hi im configuring ftp on amazon Ec2 micro linux instance but i found error
Permission denied (publickey). Couldn't read packet: Connection reset by peer
i have install vsftpd on my instance,configure fire wall open port 21, 2020 edit vsftpd.conf
enabled anonymous login = false
add user to my instance,when i login with my user above error occur,
help me what im doing wrong and where is the problem, why this error occurs.thank in advance.
I had a similar problem, if I remember rightly I solved it by changing from passive to active mode.
Make sure the folder you're connecting to is owned by root and no other user/group has write priveleges:
sudo chown root:root /home/ftpuser/
sudo chmod 755 /home/ftpuser/
You can debug connection errors by using
sftp -vvv ftpuser#12.34.56.78

Resources