Mysql-WorkBench and YubiKey ssh-tunnel - ssh

My company uses a Yubikey to connect to the ssh consoles of the systems we manage. The Yubikey uses gpg to access the ssh private key on the card, but it fails to work through Mysql Workbench and we are forced to use SequelPro. How do we get Mysql WorkBench ssh authentication through the yubikey?
Fyi, I contacted Mysql community and YubiCo and neither had an answer.

I found that we could just bind the remote MySQL port, 3306, to a local port, like 400. Assuming you have ssh working already with the Yubikey, of course. This was developed on my Ubuntu 20.04 LTS desktop, but could just as easily work on MacOSX or other Linux distros.
ssh user#host -L 4000:localhost:3306
Then in Mysql WorkBench you make a localhost tcp connection on port 4000 and you are tunneling through the ssh connection.

Related

How to use KeepassXC SSH Agent in linux terminal?

I have KeePass configured on Windows machine and SSH connnections with KeeAgent works great in Windows Terminal and Putty. Now i have new machine with linux and I'm trying to configure KeepassXC to use SSH connnections with SSH Agent in terminal. I think I did everything in KeepassXC (add new entry, turn on SSH Agent, add SSH key etc.) correctly. When I type ssh-add -l in terminal I can see that SSH key is loaded. But when I'm trying to login to the server I'm still asked for password... Please help.
Greetings,
Martin

Unable to SSH into vmware esxi 6.7 host

I want to ssh into vmware esxi 6.7 version but gets permissino denied error.
I have
1- enabled ssh on esxi 6.7 by starting TSM-SSH into host mode
2- created ssh key on remote vm
3- i can ping esxi 6.7 server
4- esxi port also working
5- in ssh config remote permission set= yes and public key authentication = yes
but still unable to ssh
i am using correct authentications. help me with this as i am new to vmware and don't know other ways
It is solved by making changes in configuration file of .ssh and checking if any firewall is active.
After this we just need to restart our ssh service.
With correct username#ip connect to our server.
This is working for me.

Passwordless connect a remote server from vagrant vm through ssh (rsync)

I'd like to run a rsync command from a vagrant vm to a remote server (to push files) without the need for a password.
So, the involved machines are: host, guest vm and remote
host is authorized on remote via authorized_keys, however when I run the rsync command from the vm I get asked for a password.
Is there a way to get passwordless rsync from the vm using the keys on the already-authorized host?
I'd like to avoid copying a new authorized key to the remote every time I create a vm.
Also, adding my server's password in the vagrant file is not an option.
Use ssh key forwarding via ssh-agent. Follow these steps:
On your host machine:
ssh-add PATH_TO_KEY <use Tab if unsure>
vagrant ssh
In the vagrant box edit your ~/.ssh/config:
Host name_or_ip_of_remote
ForwardAgent yes
Now try to connect to the remote from the vagrant box:
ssh name_or_ip_of_remote
It should work without a password. As rsync is using ssh under the hood, it will work without a password too.

How can I use SSH tunneling to connect to a remote MySQL server?

I'm using SSH tunneling for the first time, so I'm trying to understand how to configure it.
I've got a remote Linux server that hosts a MySQL database that I'm trying to connect to. In order to access the MySQL database directly through a software that only recognizes local databases, I suppose SSH tunneling would be the right way to set up the access, correct?
Now, I'm trying to set up the tunneling on my 'home' computer which is running the software that's trying to access the MySQL database. My first question is whether this is reverse tunneling or normal tunneling? Secondly, is it local tunneling or remote tunneling?
Finally, from what I understand, my code is supposed to look something like
ssh -L 8080:mylinuxserver.mycompany.com:22 myuser#mylinuxserver.mycompany.com
Is this correct? Is my source port '22' since I'm using SSH and is my destination port 8080 (or is there something more appropriate)?
When I try to use the above code, I am able to login using my passphrase (since my key is already in the MyLinuxServer) but when I ping localhost:8080, it cannot find the host.
What am I doing wrong?
I've got a remote Linux server that hosts a MySQL database that I'm trying to connect to
The command should be:
ssh -L 8080:localhost:3306 myuser#mylinuxserver.mycompany.com
Where:
8080: is hte local port on your workstation
localhost: is corresponding to mylinuxserver.mycompany.com
3306: the MySQL port on above localhost.
then connect (from your workstation) to MySQL as:
mysql -h 127.0.0.1 --port=8080
Besides, ping localhost:8080 is wrong. Ping cannot work that way.
Try this:
ssh -f ssh_user#mylinuxserver.mycompany.com -L 3307:mysql1.example.com:3306 -N
Next, to access the mysql your trying to connect to:
mysql -h 127.0.0.1 -P 3307

How do you do DNS over SSH reliably?

How do you do DNS over SSH using Windows client and linux server reliably?
I found a reliable way to do it using socat -> ssh -> socat