issue with ssh-copy-id rootname#ipaddress - ssh

I am getting repeated errors whenever i am executing ssh-copy-id root#ip.
/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/aasthajainsimpl/.ssh/id_rsa.pub"
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: ERROR: ssh: connect to host 13.89.203.233 port 22: Connection timed out
enter image description here

Looks like the 13.89.203.233 host doesn't have ssh server on port 22 (or this port is behind of firewall). Try to see into sshd.conf or firewall config.
Also maybe the IP address is wrong - it belongs to Microsoft.

Related

testing ssh connection error "ssh: Could not resolve hostname hostname: Temporary failure in name resolution"

I am following this page on how to test ssh connection.
When i enter this first line:
$ ssh -T git#hostname
I get an error:
ssh: could not resolve hostname
hostname: Temporary failure in name resolution
Make sure you can ping hostname, meaning your DNS does resolve hostname into an IP address.
If not, then SSH would fold back to ~/.ssh/config, looking for a Host hostname entry which would indicate what 'hostname' actually means.
Of course, replace 'hostname' by the actual remote host name you want to reach with this SSH session.
After that, it depends on your OS (Windows, Linux, ...), both for the source and the target.

SSH connection refused with DNS

I have searched and I know people have asked this before, but I have been through all settings and double, triple checked everything but I can't get it to work for the life of me. I have not this before with other machines, but I don't know why this isn't working.
*note: numbers have been changed for security reasons
Here is what I have:
Client
Raspberry Pi 3 with IP: 192.168.0.133
manual port in raspberry pi 3 sshd_config file: 1502
Router:
NAT Virtual Server:
External port: 1502
Internal port: 22
IP address: 192.168.0.133
DNS(duckdns.org)
- checked to make sure public IP address points to the domain: testing2#duckdns.org
ssh command that works on client:
ssh -p 1502 client#192.168.0.133
ssh command that doesn't work
ssh -p 1502 client#testing2.duckdns.org
So I'm not sure where it's going on. here is output from ssh -v -p 1502 client#testing2.duckdns.org
OpenSSH_7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /Users/testing/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to testing2.duckdns.org [188.45.22.61] port 1502.
debug1: connect to address 188.45.22.61 port 1502: Connection refused
ssh: connect to host testing2.duckdns.org port 1502: Connection refused
Any ideas? I really would appreciate any insights.
EDIT: To add some more clarifying information:
When I run the second command listed above, that is failing:
ssh -p 1502 client#testing2.duckdns.org
This goes out to the DNS I have setup (testing2.duckdns.org) and that DNS points to my network's public facing IP address. At that point, it hits the NAT routing rule I have setup on my router that forwards any requests from port 1502 to the internal port of 22 to the IP address of 192.168.0.133.
This is why I don't understand where it is failing, all the rules are there and the route should be open. Is there a setting on the raspberry pi (within the config file) that I'm missing?
So I figured out what was going on, and although I am still not able to connect remotely, I have solved what the original question posed.
The problem was I had changed the port on the raspberry pi (the internal port) to 1502. This meant that the route was forwarding correctly (from external of 1502 to internal of 22) but then the internal port was set to 1502, so it failed to connect.
This also explains why it would connect locally with the above command because the local port was 1502.
I still can't connect remotely because the raspberry pi is running a VPN and this is causing the SSH request to timeout, but that is a separate question.
Thanks for the help everyone!

QEMU SPARC VM - SCP to localhost

I have to use QEMU VM to emulate SPARC. I've been trying to SCP my finished assignment to my localhost, but I seem to be unable to. Whenever I try:
scp assignment6.zip user#ipv4address:~/
I get this error:
ssh: connect to host ipv4address port 22: Connection refused
I've opened up port 22, and still continue to get this error.
I assume there's something simple I'm missing, but I can really see what it is.
If there are any suggestions, I'd be grateful to hear them.
It's not enough to have the port "open" in the firewall. The "connection refused" message usually means that there is no process listening on the port. I'd recommend checking to see if you actually have an ssh server running on the localhost.

SSH Connection Being Refused When I'm Remote, but not Local (Port Forwarding Already Enabled)

I set up SSH on my Ubuntu server (running XMonad) and generated a key for my laptop that I used to connect to my home server with. I also went on my wireless router and forward port 22 for SSH use. I can SSH fine when I'm at home using the standard:
ssh user#ipaddress
However when I'm outside of my local network I get this error:
ssh: connect to host xxx.xx.xx.xxx port 22: Connection refused
Everything I read says I need to either a) check that my port 22 is forward (which it is) or b) check that sshd is actually running on my Ubuntu server (which it is).
Any ideas what is preventing my SSH from working when I'm remote?
Add the following line your ssh user config file if it doesn't exits You can create the config file as shown below.
vi ~/.ssh/config
Host *
ServerAliveInterval 300
Change the permission as below:
chmod 600 ~/.ssh/config
Restart the daemon. Hope this helps.
https://serverfault.com/a/371563/617303
For me this was the cause.
In your /etc/ssh/sshd_config or /etc/ssh_ssh_config check to make sure GSSAPI Auth is disabled (set to no).
GSSAPIAuthentication no
Then restart the service or machine.

cygwin connection refused for port 22

I have installed cygwin in windows 7 but i get the following error
$ ssh localhost
ssh: connect to host localhost port 22: Connection refused
I faced the same problem but I ran this on the CYGWIN command line and it worked :
~ : net start sshd
After that I executed the command ssh -v localhost and the error message didn't show up. Hope that this helps !.
If you are facing this problem in Windows XP follow these steps to open port for ssh:
Go to windows firewall of security section in control panel
Exceptions->add port
Give port name as ssh and number as 22.
Select option TCP
Click on Ok
This will help you open ssh from cygwin
For local application development like hadoop on windows please change the scope localhost /ip address in the custom list.
You can try to use port 23 or ask your host provider for the ssh port. Some host providers change the ssh port.
ssh user#yoursite.com -p 23
Cygwin doesn't install an SSH server by default, although you can set up sshd if you want. By default, however, there's nothing to ssh to.
Follow the steps in this link and then do a
$~ net start sshd
$~ ssh localhost