Connect to openshift using `rhc ssh` on Windows without PuTTY - ssh

I have an Openshift app, and a Windows install with ssh provided by Git-for-Windows (under cmder). I do not have PuTTY installed.
When I run rhc ssh app, I get the error:
Connecting to <UID>#app-domain.rhcloud.com ...
Using username "<UID>".
FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey,gssapi-keyex,gssapi-with-mic)
If I run rhc ssh -d app to get better diagnostics, I end up with a trace containing:
DEBUG: Invoking Kernel.exec with ["C:\\Program Files\\PuTTY\\plink.exe", "-vv", "<UID>#app-domain.rhcloud.com"]
plink: unknown option "-vv"
...so it looks like rhc ssh is trying to use PuTTY. In fact, if I run
rhc ssh --ssh C:\Users\me\Downloads\cmder\vendor\git-for-windows\usr\bin\ssh.exe app
Then the connection works.
Can I setup rhc so that it tries to use the ssh I have installed, instead of looking for PuTTY?

You have to fix the environment variable PATH, because rhc uses the default ssh client.
If you don't have PUTTY installed, the easiest solution is to add the C:\Users\me\Downloads\cmder\vendor\git-for-windows\usr\bin\ folder (which includes ssh.exe) to the PATH environment variable.
By the way, I suggest to move git-for-windows in another folder.

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

Why i can’t connect to Gitlab on a container via SSH?

I have installed a local Gitlab in Portainer CE on Asustor.
I used putty to try to connect via SSH with the right port to Gitlab but it’s respond with “no supported authentication methods available (server sent publickey)”.
I try to create a new SSH key, and i put it on gitlab without success. On the Asustor the service of SSH is active in fact when i try to connect via SSH to the Asustor, it’s responde correctly. I used port 22 for SSH of Asustor and port 49165 for SSH of Gitlab. Anyone can help me?
Thanks
Check first if you have a GIT_SSH environment variable which would not use ssh.exe from Windows (C:\Windows\System32\OpenSSH\ssh.exe) or from Git (C:\Program Files\Git\usr\bin\ssh.exe)
In general, there is no need for PuttyGen to manage SSH connections on Windows.
If your GitLab runs in a Docker container on your NAS, you might need to map its internal SSH port to the host (Asustor) port 22, as described in this thread.

Jmeter SSH sampler can't establish socket error

OS: Mac OS Sierra
So I installed Jmeter and SSH sampler plugin. I want to access api host to send execute command on it via ssh. I am able to connect to this host via ssh using my ssh key, but can't do the same using Jmeter SSH Sampler.
Keep getting:
'Failed to connect to server: timeout: socket is not established'
.
Currently I'm out of ideas, how would I achieve this? Are there any peculiarities or additional settings I'm missing?
Adding screens with settings. I am filling in IP address of host, which I can access, just can't publish it.
The key is in OpenSSH format.
response_screen sampler_settings
Remote Commands: Linux/MacOSX
Linux, Unix and MacOSX operating systems can be remotely accessible (in majority of cases) through SSH (Secure Shell) protocol. To accomplish that
we can use the JMeter SSH Sampler plugin.
Installation:
Download ApacheJMeter_ssh-x.x.x.jar and jsch-x.x.x.jar from the SSH Sampler Releases page.
Drop Apache_JMeter_ssh-x.x.x.jar to /lib/ext folder of your JMeter installation.
Drop jsch-x.x.x.jar to /lib folder of your JMeter installation.
Restart JMeter.
You should see 2 new Samplers: SSH Command and SSH SFTP.
Your login can fail due to DDS key being rejected. As per OpenSSH 7.0 release notes:
Support for ssh-dss, ssh-dss-cert-* host and user keys is disabled
by default at run-time. These may be re-enabled using the
instructions at http://www.openssh.com/legacy.html
Alternatively you can specify path to id_rsa private key file
I don't think SSH Command sampler understands ~ shorthand, you should be providing full path to your SSH private key
You have to provide your SSH username as well
In any case make sure you can reach the port 22 of the machine where the SSH server is running from the machine where JMeter is running.
More information: How to Run External Commands and Programs Locally and Remotely from JMeter

Configuring SFTP in Pycharm

I'm trying to setup Pycharm such that my local changes are automatically deployed to a remote server.
I can ssh remoteserver and also sftp remoteserver from the terminal so access is not an issue. But if I try to setup deployment in Pycharm using SFTP, it can't establish the connection.
My best guess is that it's an authentication issue. When running the ssh or sftp commands separately, I've never needed to enter a username or password, so I suppose the auth is happening via Private Key. But the problem is that I'm not sure where the Private Key actually is (I'm in an unfamiliar dev environment).
So either
How do I know which Private Key I'm using when running ssh or sftp?
Any other way to resolve the problem.
Thanks!
As to (1), the SSH man page says (under the -i option) "The default is ~/.ssh/identity for protocol version 1, and ~/.ssh/id_rsa and ~/.ssh/id_dsa for protocol version 2. Identity files may also be specified on a per-host basis in the configuration file."
The configuration file is ~/.ssh/config, and the key file for a particular host is specified with IdentityFile.
You can also run ssh with -vvv parameter. The location of the private key file will be printed out (if key authentication is used).

Does the .ssh file automatically come installed on a linux system by default?

If I tell someone to look in
~/.ssh
Can I assume that that folder will always exist on a nix filesystem? Specifically, is it always there on the standard distros of linux and MacOsx? I'm following the github generate ssh keys tutorial, and it appears to assume that ssh is something included by default. Is that true?
Update: apparently MAC OSX has an ssh server installed by default, but it is not enabled. according to the log by Chris Double,
The Apple Mac OS X operating system has SSH installed by default but the SSH daemon is not enabled. This means you can’t login remotely or do remote copies until you enable it.
To enable it, go to ‘System Preferences’. Under ‘Internet & Networking’ there is a ‘Sharing’ icon. Run that. In the list that appears, check the ‘Remote Login’ option.
This starts the SSH daemon immediately and you can remotely login using your username. The ‘Sharing’ window shows at the bottom the name and IP address to use. You can also find this out using ‘whoami’ and ‘ifconfig’ from the Terminal application.
On OS X, Ubuntu, CentOS and presumably other linux distros the ~/.ssh directory does not exist by default in a user's home directory. On OS X and most linux distros the ssh-client and typically an ssh server are installed by default so that can be a safe assumption.
The absence of the ~/.ssh directory does not mean that the ssh client is not installed or that an ssh server is not installed. It just means that particular user has not created the directory or used the ssh client before. A user can create the directory automatically by successfully sshing to a host which will add the host to the client's ~/.ssh/known_hosts file or by generating a key via ssh-keygen. A user can also create the directory manually via the following commands.
mkdir ~/.ssh
chmod 700 ~/.ssh
To test whether an ssh client and/or server is installed and accessible on the path you can use the which command. Output will indicate whether the command is installed and in the current user's path.
which ssh # ssh client
which sshd # ssh server
I would say no. I guess on 99% of the systems there is an ssh server running but IMHO in most cases you need to install that software on your own.
And even if it is installed, the directories are created on the first usage of ssh for that user.