Unable to ssh from windows to Linux machine getting error ssh: connect to host "Ip Address" port 22: Bad file number - linux

I trying to SSH to Linux machine and getting this error Bad file number
I hit this command on GitBash
$ ssh host_name#IP address
ssh: connect to IP address port 22: Bad file number
Please help me.
Previously I am able ssh to Linux machine.
Thanks

You just should do :
ssh -T user#ip
If you have a passphrase, you have to write it after when it will be asked. Then you'll get a success message.
That has worked for me.

Related

ssh: connect to host ********* port 22: Connection timed out

I have Ubuntu 22.04 newly installed on my laptop. I am trying to connect to a remote server and getting the following error:
ssh: connect to host ********* port 22: Connection timed out
I tried some solutions which include,
ping the IP address
adding the IP address to the firewall using sudo ufw
installing ssh and openssh
However, nothing seems to work. I'd be thankful if someone can help me to solve this problem.
If you can ping the server it can be the following causes:
The server is not answering ssh, sometimes ssh server is not up or it is answering in another port.
There is a firewall blocking your request.
You do not need to install the openssh server in your computer to access a remote hosts and normally outbound connections are allowed by ufw.
ssh: connect to host ********* port 22: Connection timed out
I have this kind of problem too I contact the server admin and said the operation system should be install again due to some problems
after re installing the problem solved try it it may works

Accessing CRC (OpenShift) on a remote server: "openshift crc ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection refused"

I ask you for help because I was unable to access the OpenShift web console, installed in a VM, from my pc.
I am not an expert on linux, so please excuse me if I make any mistakes in exposing the problem.
I followed these steps:
I accessed the shell of the VM via SSH.
I successfully installed CRC on VM following this guide: https://crc.dev/crc/#installation_gsg.
I added at the end of my computer's etc/hosts file the following line: 127.0.0.1 oauth-openshift.apps-crc.testing console-openshift-console.apps-crc.testing downloads-openshift-console.apps-crc.testing default-route-openshift-image-registry.apps-crc.testing canary-openshift-ingress-canary.apps-crc.testing
I tried to access the web console of Openshift via SSH with this command: ssh -L 443:console-openshift-console.apps-crc.testing:443 myuser#xxx.xx.x.xxx
But I got the following error message: ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection refused.
If it helps, by running the same command with -v flag, I get: debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
What could be the problem? Did I do something wrong or did I forget any configuration to do?
Many thanks in advance.

Unable to clone github repository

I have generated ssh keys from my terminal and placed an entry in my SSH keys section in github.com.
After that, I am just trying to clone my repository, but I get the following error message :
git clone git#github.com:XYZXY/XXXXXXXXXX.git
Initialized empty Git repository in /home/XYZXY/.ssh/XXXXXXXXXXXXX/.git/
ssh: connect to host ssh.github.com port 22: Connection refused
fatal: The remote end hung up unexpectedly
I tried this one too :
ssh -T git#github.com
ssh: connect to host ssh.github.com port 22: Connection refused
My question is :
1) Is source side blocking the connection ?
2) Is Target not allowing the connection ?
Try running this command for more information.
telnet ssh.github.com 22
You should see something like this.
~ $ telnet ssh.github.com 22
Trying 192.30.253.122...
Connected to ssh.github.com.
Escape character is '^]'.
SSH-2.0-libssh-0.7.0
If you do not, then something (possibly a firewall block?) is preventing you from accessing github.

Connect two local linux computers via ssh

I would like to know how to connect two linux computers (Ubuntu and OpenSuse) via SSH. When I try to run this command on Suse:
ssh 192.168.1.37
I get error:
ssh : connect to host 192.168.1.37 port 22 : connection refused.
When I try to connect from Ubuntu PC with the same command and Suse's IP, I get "connection timeout" error.
Any help would be appreciated.
Install SSH server in the machine you want to connect, by issuing the command:
sudo apt-get install openssh-server -y
After that, you can connect to that machine by executing the following command:
ssh user#ip_address
where user is the name of the user in that machine you want to connect to with which you want to be authenticated, and ip_address is the IP address of that same machine.
When logging in, try to specify the user you want as well, so that the command looks something like this
ssh example#192.168.1.37
Try using this if its default user
ssh root#192.168.1.16
ssh root#device_ip_address
root is the default user for dietpi
Try the following command by specifying the username followed by # and the IP address (i.e. the hostname).
ssh user#192.168.1.1
Here, user is the username of the user in the machine you want to connect to, followed by the IP address of the host, which in this case is 192.168.1.1.

SSH Permission denied for Mininet

I am new to SDN and was trying to learn Mininet. I have installed debian(64-bit) and Mininet on Virtual Box. When I try to connect Mininet Vm from Debian I have to run the following comamnd :
ssh -X mininet#10.0.2.15
It asks for mininet password, but after entering the default mininet password it shows an error
Permission denied please try again
Both my debian and Mininet VM have same IP address. Kindly guide how to eliminate the SSHerror. Also is it fine having same ip address for two different VM, is the SSH error a result of this ?
Thanks
In the VirtualBox settings under the tab Network click on Advanced then Port Forwarding and add a rule with name: ssh, protocol: tcp, host port: 3022 and guest port: 22. Then execute:
sudo ssh -p 3022 mininet#10.0.2.15

Resources