Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

SSH: Connection closed by remote ip X.X.X.X port 22

Writer Sophia Terry

UpdateI'm currently running 20.04 now. I did some more research and that your ip address is registered to a domain. You have to use actual domain instead. SSH Public key is configured for the domain. I logged on with the MTU reduced. Despite the research I still have the error.

Current Problem:

I have tried almost everything to solve this. When I run ssh root@{ip.address}. This happens Connection closed by {ip address} port 22 this error comes up. I ransudo ss -tulpn | grep :22[Solved]

tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd"
tcp LISTEN 0 128 [::]:22 [::]:* users:(("sshd"

I've permitted the RootLoginHere's ssh -vvv {domain@example}:

 OpenSSH_8.2p1 Ubuntu-4ubuntu0.3, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /home/user/.ssh/config
debug1: /home/user/.ssh/config line 1: Applying options for domain@example
debug3: kex names ok: [diffie-hellman-group1-sha1]
debug1: /home/user/.ssh/config line 4: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolving "domain@example" port 22
debug2: ssh_connect_direct
debug1: Connecting to domain@example [ip address] port 22.

Ran tail -n 500 /var/log/auth.log | grep ssh

user sudo: user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/apt install openssh-server openssh-client
user useradd[17976]: new user: name=sshd, UID=128, GID=65534, home=/run/sshd, shell=/usr/sbin/nologin, from=none
user usermod[17984]: change user 'sshd' password
user chage[17991]: changed password expiry for sshd
user sshd[18118]: Server listening on 0.0.0.0 port 22.
user sshd[18118]: Server listening on :: port 22.
user sudo: user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/usr/sbin/ufw allow ssh
user sudo: user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/nano /etc/ssh/sshd_config
user polkitd(authority=local): Operator of unix-session:2 successfully authenticated as unix-user:user to gain TEMPORARY authorization for action org.freedesktop.systemd1.manage-units for system-bus-name::1.212 [systemctl restart sshd.service] (owned by unix-user:user)
user sshd[18118]: Received signal 15; terminating.
user sshd[24826]: Server listening on 0.0.0.0 port 22.
user sshd[24826]: Server listening on :: port 22.
user sudo: user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/usr/sbin/ufw allow ssh
user sshd[28153]: Accepted publickey for elizabeth from 127.0.0.1 port 32912 ssh2: RSA
user sshd[28153]: pam_unix(sshd:session): session opened for user user by (uid=0)
user sshd[29442]: Connection closed by 127.0.0.1 port 50390 [preauth]
user sshd[29591]: Accepted publickey for user from 127.0.0.1 port 50548 ssh2: RSA
user sshd[29591]: pam_unix(sshd:session): session opened for user user by (uid=0)
user sshd[29647]: Received disconnect from 127.0.0.1 port 50548:11: disconnected by user
user sshd[29647]: Disconnected from user user 127.0.0.1 port 50548
user sshd[29591]: pam_unix(sshd:session): session closed for user user sshd[28247]: Received disconnect from 127.0.0.1 port 32912:11: disconnected by user
user sshd[28247]: Disconnected from user user 127.0.0.1 port 32912
user sshd[28153]: pam_unix(sshd:session): session closed for user user user sshd[812]: Server listening on :: port 22.

Omitted ip address, my name, website and key for privacy

Confirmed I have authorized_keys.

 ls -l .ssh/authorized_keys
-rw------- 1 user user 573 Sep 10 18:06 .ssh/authorized_keys
9 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy