Unable to push 'heroku master' - ruby-on-rails

When I tried to run 'git push heroku master', I got the error
ssh: connect to host heroku.com port 22: Connection timed out
fatal: The remote end hung up unexpectedly
I run the command 'ssh -vvv git#heroku.com' to know what is happening, the result is
OpenSSH_5.9p1 Debian-5ubuntu1.3, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to heroku.com [50.19.85.154] port 22.
debug1: connect to address 50.19.85.154 port 22: No route to host
debug1: Connecting to heroku.com [50.19.85.132] port 22.
debug1: connect to address 50.19.85.132 port 22: No route to host
debug1: Connecting to heroku.com [50.19.85.156] port 22.
debug1: connect to address 50.19.85.156 port 22: No route to host
ssh: connect to host heroku.com port 22: No route to host
I'm a newbie to deployment and ssh. Please help.

Related

openssh-server in a pod | ssh connection fails with error: Connection reset by <IP> port 30500

**Logs from sshd server
`debug2: load_server_config: filename /etc/ssh/sshd_config
debug2: load_server_config: done config len = 806
debug2: parse_server_config: config /etc/ssh/sshd_config len 806
debug3: /etc/ssh/sshd_config:17 setting Port 30500
debug3: /etc/ssh/sshd_config:19 setting ListenAddress 0.0.0.0
debug3: /etc/ssh/sshd_config:22 setting HostKey /etc/ssh/ssh_host_rsa_key
debug3: /etc/ssh/sshd_config:23 setting HostKey /etc/ssh/ssh_host_ecdsa_key
debug3: /etc/ssh/sshd_config:24 setting HostKey /etc/ssh/ssh_host_ed25519_key
debug3: /etc/ssh/sshd_config:36 setting SyslogFacility AUTH
debug3: /etc/ssh/sshd_config:38 setting LogLevel VERBOSE
debug3: /etc/ssh/sshd_config:43 setting PermitRootLogin yes
debug3: /etc/ssh/sshd_config:44 setting StrictModes no
debug3: /etc/ssh/sshd_config:52 setting AuthorizedKeysFile .ssh/authorized_keys
debug3: /etc/ssh/sshd_config:60 setting HostbasedAuthentication no
debug3: /etc/ssh/sshd_config:68 setting PasswordAuthentication no
debug3: /etc/ssh/sshd_config:73 setting ChallengeResponseAuthentication no
debug3: /etc/ssh/sshd_config:83 setting GSSAPIAuthentication no
debug3: /etc/ssh/sshd_config:84 setting GSSAPICleanupCredentials no
debug3: /etc/ssh/sshd_config:105 setting X11Forwarding yes
debug3: /etc/ssh/sshd_config:131 setting AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
debug3: /etc/ssh/sshd_config:132 setting AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
debug3: /etc/ssh/sshd_config:133 setting AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
debug3: /etc/ssh/sshd_config:134 setting AcceptEnv XMODIFIERS
debug3: /etc/ssh/sshd_config:137 setting Subsystem sftp /usr/libexec/openssh/sftp-server
debug1: sshd version OpenSSH_7.4, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: private host key #0: ssh-rsa SHA256:6XsUKJrlEzspiLw1H/e5qfrzga/n4Rgs
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:yJkcJ2AX3E4dOADjCRn9EWnut+z5nW3xKhGOc
debug1: private host key #2: ssh-ed25519 SHA256:GHvEepwimuJpanKOXJx8Aacpcs8MwXxlmaU7Q
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-ddd'
debug3: oom_adjust_setup
debug1: Set /proc/self/oom_score_adj from 1000 to -1000
debug2: fd 3 setting O_NONBLOCK
debug1: Bind to port 30500 on 0.0.0.0.
Bind to port 30500 on 0.0.0.0 failed: Address already in use.
Cannot bind any address.`
Logs from ssh command:
`ssh -vvv localhost -p 30500`
`OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving "localhost" port 30500
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to localhost [::1] port 30500.
debug1: connect to address ::1 port 30500: Connection refused
debug1: Connecting to localhost [127.0.0.1] port 30500.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: match: OpenSSH_7.4 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to localhost:30500 as 'root'
debug3: put_host_port: [localhost]:30500
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
Connection reset by 127.0.0.1 port 30500`
Server seems running fine
`netstat -anp | grep 30500`
`tcp 0 0 0.0.0.0:30500 0.0.0.0:* LISTEN 1/sshd`
Observations
The same image works fine when run as a docker container locally (with the same sshd_config temporarily allowing password auth)
The service picks the correct endpoint and we can telnet to the custom ssh port > 30500
The SSH process is running in the pod
Telnet to the ssh port works fine (from another pod, from outside the cluster)
Another container within the same pod with nginx on port 80 works just fine
At present, we get the error Connection reset by port 30500
a) NodePort or LoadBalancer(OCI) does not work
b) In fact ssh to localhost from within the pod fails as well (or from another pod, or from the worker node)
Any guidance here please?

Hadoop ssh: connect to host localhost port 22: Cannot assign requested address

I am creating docker image for hadoop using steps mentioned here
I can build the image
but while starting hadoop, i am getting below error
bash-4.2# sh $HADOOP_HOME/sbin/start-dfs.sh
Starting namenodes on [localhost]
localhost: ssh: connect to host localhost port 22: Cannot assign requested address
localhost: ssh: connect to host localhost port 22: Cannot assign requested address
Starting secondary namenodes [0.0.0.0]
0.0.0.0: ssh: connect to host 0.0.0.0 port 22: Connection refused

docker run open a X window and stay idle

I'm connecting to a remote machine (from windows to centos) and try to run a docker container.
For example, docker pull hello-world, X window is comming up
and nothing append.
ssh -vvv name#remote
the same command docker pull hello-world gives :
debug1: client_input_channel_open: ctype x11 rchan 4 win 65536 max 16384
debug1: client_request_x11: request from ::1 35164
debug2: fd 8 setting TCP_NODELAY
debug2: fd 8 setting O_NONBLOCK
debug3: fd 8 is O_NONBLOCK
debug1: channel 1: new [x11]
debug1: confirm x11
I wonder how to debug this behavior. I think it may come from ssh configuration but not sure.

SSH to docker bridged instance

I'm trying to run some Docker instances to allow Jenkins to perform some jobs on them.
I followed this tutorial (http://devopscube.com/docker-containers-as-build-slaves-jenkins/) to achieve it. It's currently creating some new docker instances, but it does not connect to them.
All of these new docker instances must have direct access to physical network, so they have to be built with "-net=bridge". Each port 22 of each docker container is being binded to a free host port.
So, the thing is that I cannot reach any docker instance through SSH access.
Moreover, If I get into one of these docker instances, i'm not able to do ssh to localhost getting the next:
[jenkins#d4084633f2bc ~]$ ssh localhost -v
OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /home/jenkins/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file /home/jenkins/.ssh/id_rsa type -1
debug1: identity file /home/jenkins/.ssh/id_rsa-cert type -1
debug1: identity file /home/jenkins/.ssh/id_dsa type -1
debug1: identity file /home/jenkins/.ssh/id_dsa-cert type -1
debug1: identity file /home/jenkins/.ssh/id_ecdsa type -1
debug1: identity file /home/jenkins/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/jenkins/.ssh/id_ed25519 type -1
debug1: identity file /home/jenkins/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
Read from socket failed: Connection reset by peer
How can I solve this? Does anybody know it?
Thanks in advance.

ssh: connect to host heroku port 22: Connection refused

I'm trying to push a Rails application up to heroku and it continuously gives me this error:
ssh: connect to host 107.21.95.3 port 22: Connection refused
fatal: Could not read from remote repository.
This worked earlier in the week at both a public wifi location and a private wifi location. I have looked at ssh-connect-to-host-heroku and git-push-heroku-master. Through these two answers I uninstalled and reinstalled the Heroku Toolbelt, added a new SSH key to heroku, and created a new application in heroku to push to.
When I use ssh -T heroku.com or ssh -vT heroku.comI respectively get:
ssh: connect to host 107.21.95.3 port 22: Connection refused
and
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/christinaleuci/.ssh/config
debug1: /Users/christinaleuci/.ssh/config line 2: Applying options for heroku.com
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to 107.21.95.3 [107.21.95.3] port 22.
debug1: connect to address 107.21.95.3 port 22: Connection refused
ssh: connect to host 107.21.95.3 port 22: Connection refused
I have had a lot of problems with keys and Heroku. I started using Heroku Accounts and that has made it a lot easier. Make sure your public key is listed within your account under SSH keys here.
BTW, ssh -v git#heroku.com fails for me when using Heroku Accounts but I am able to use my accounts without issue.
I had the same error and found out at that SSH was blocked at my office. If you can't SSH to anywhere that's might be your problem, but if you can SSH to somewhere that's not Heroku I'm not sure.

Resources