0

Having an issue using SSH, I attempt to log in to my server using SSH and have no issues if an account is locally logged in. However if an account is not logged into locally I get an error that says "operation timed out". After some research people suggested to move the authorized_keys file and I tried that using the permissions suggested by that user. However this issue still persists. Any ideas what I might be missing?

Output of tail -f /var/log/auth.log

Mar 26 11:39:47 cname pkexec[2577]: uname: Executing command [USER=root] [TTY=unknown] [CWD=/home/unname] [COMMAND=/usr/bin/cpufreqctl on 1] Mar 26 11:39:47 cname pkexec: pam_unix(polkit-1:session): session opened for user root by (uid=1000) Mar 26 11:39:47 cname pkexec[2584]: uname: Executing command [USER=root] [TTY=unknown] [CWD=/home/uname] [COMMAND=/usr/bin/cpufreqctl on 2] Mar 26 11:39:47 cname pkexec: pam_unix(polkit-1:session): session opened for user root by (uid=1000) Mar 26 11:39:47 cname pkexec[2591]: uname: Executing command [USER=root] [TTY=unknown] [CWD=/home/uname] [COMMAND=/usr/bin/cpufreqctl on 3] Mar 26 11:40:10 cname dbus-daemon[861]: [system] Failed to activate service 'org.bluez': timed out (service_start_timeout=25000ms) Mar 26 11:41:15 cname sshd[2911]: Connection closed by authenticating user uname 10.0.1.8 port 50209 [preauth] Mar 26 11:41:31 cname sshd[2942]: Accepted publickey for uname from 10.0.1.8 port 50212 ssh2: RSA SHA256:Ae/Ak3P6EaQ/iGY4ZkZ6hXemzUWY+UDJ2uyAZggZ4gk Mar 26 11:41:31 cname sshd[2942]: pam_unix(sshd:session): session opened for user uname by (uid=0) Mar 26 11:41:31 cname systemd-logind[895]: New session 4 of user uname.

Output of journalctl -u ssh -ef

-- Reboot -- Mar 26 11:38:43 cname systemd[1]: Starting OpenBSD Secure Shell server... Mar 26 11:38:43 cname sshd[988]: Server listening on 0.0.0.0 port 34. Mar 26 11:38:43 cname sshd[988]: Server listening on :: port 34. Mar 26 11:38:43 cname systemd[1]: Started OpenBSD Secure Shell server. Mar 26 11:39:44 cname systemd[1]: Reloading OpenBSD Secure Shell server. Mar 26 11:39:44 cname sshd[988]: Received SIGHUP; restarting. Mar 26 11:39:44 cname systemd[1]: Reloaded OpenBSD Secure Shell server. Mar 26 11:39:44 cname sshd[988]: Server listening on 0.0.0.0 port 34. Mar 26 11:39:44 cname sshd[988]: Server listening on :: port 34. Mar 26 11:39:44 cname systemd[1]: Reloading OpenBSD Secure Shell server. Mar 26 11:39:44 cname sshd[988]: Received SIGHUP; restarting. Mar 26 11:39:44 cname systemd[1]: Reloaded OpenBSD Secure Shell server. Mar 26 11:39:44 cname sshd[988]: Server listening on 0.0.0.0 port 34. Mar 26 11:39:44 cname sshd[988]: Server listening on :: port 34. Mar 26 11:41:15 cname sshd[2911]: Connection closed by authenticating user uname 10.0.1.8 port 50209 [preauth] Mar 26 11:41:31 cname sshd[2942]: Accepted publickey for uname from 10.0.1.8 port 50212 ssh2: RSA SHA256:Ae/Ak3P6EaQ/iGY4ZkZ6hXemzUWY+UDJ2uyAZggZ4gk Mar 26 11:41:31 cname sshd[2942]: pam_unix(sshd:session): session opened for user uname by (uid=0) Mar 26 12:51:54 cname sshd[988]: Received signal 15; terminating. Mar 26 12:51:54 cname systemd[1]: Stopping OpenBSD Secure Shell server... Mar 26 12:51:54 cname systemd[1]: Stopped OpenBSD Secure Shell server. -- Reboot -- Mar 26 12:52:14 cname systemd[1]: Starting OpenBSD Secure Shell server... Mar 26 12:52:14 cname sshd[981]: Server listening on 0.0.0.0 port 34. Mar 26 12:52:14 cname sshd[981]: Server listening on :: port 34. Mar 26 12:52:14 cname systemd[1]: Started OpenBSD Secure Shell server. Mar 26 12:55:41 cname systemd[1]: Reloading OpenBSD Secure Shell server. Mar 26 12:55:41 cname sshd[981]: Received SIGHUP; restarting. Mar 26 12:55:41 cname systemd[1]: Reloaded OpenBSD Secure Shell server. Mar 26 12:55:41 cname sshd[981]: Server listening on 0.0.0.0 port 34. Mar 26 12:55:41 cname sshd[981]: Server listening on :: port 34. Mar 26 12:55:41 cname systemd[1]: Reloading OpenBSD Secure Shell server. Mar 26 12:55:41 cname sshd[981]: Received SIGHUP; restarting. Mar 26 12:55:41 cname sshd[981]: Server listening on 0.0.0.0 port 34. Mar 26 12:55:41 cname sshd[981]: Server listening on :: port 34. Mar 26 12:55:41 cname systemd[1]: Reloaded OpenBSD Secure Shell server.

1 Answer 1

0

Do you have per-user encryption, or EncryptedHome? If so, the EncryptedHome documentation describes working around issues with ssh.

By default, sshd looks in ~/.ssh/authorized_keys. If your directory is encrypted, this file is not available. To solve this problem, you can store each user's authorized_keys files outside of their encrypted, home directory, which is controlled in /etc/ssh/sshd_config. Changes to this configuration file are not seen until sshd restarts, ie: $ sudo systemctl restart sshd .

Be sure to check out that documentation for all available solutions, and take notice how cron can have issues as well.

3
  • sorry I wasn't clear when I was talking about the authorized_key folder. I did indeed follow the steps you outlined also verified the permissions of the folder once moved to the /etc/ssh/uname. When you had mentioned cron are you referring to using cron to start the ssh service ?
    – SofaSloth
    Mar 26, 2019 at 6:24
  • cron is unrelated to your ssh issue. Just wanted to mention that it falls under similar issues with EncryptedHome. After you restart sshd, have you taken a look at logs provided? Could you update your question with some logs/errors? journalctl -u sshd -ef or tail -f /var/log/auth.log. This will show the 'server' errors, vs the 'client' error "Operation Timed Out" that you see in your terminal.
    – earthmeLon
    Mar 26, 2019 at 15:48
  • Added requested log files
    – SofaSloth
    Mar 26, 2019 at 20:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .