Questions tagged [ssh]
Secure Shell (SSH) is a protocol primarily for encrypted shell connections. This tag is also used for questions about sshd and openssh, the two standard applications for using SSH.
9,104 questions
1 vote
1 answer
33 views
Why is ip6tables blocking ssh?
I'm unable to connect to one of my servers using ssh over IPv6. sshd is configured to listen on tcp/922. I found this in my server log: 2025-12-09T13:44:14.917279-05:00 myserver kernel: ip6tables ...
3 votes
1 answer
108 views
SSH Public Key authentication bypasses Google LDAP account status check (SSSD/PAM)
I am currently configuring SSSD to authenticate Ubuntu 24.04 servers against Google Secure LDAP. I want users to be able to log in using SSH Keys for convenience. However, if I suspend/disable a user ...
2 votes
0 answers
173 views
SSH connection to docker container when host is connected to VPN
I am having an issue establishing a ssh connection to my docker container when the docker host is connected to a vpn (nordvpn). Here is what I have done : On my router : i have port forwarded an ssh ...
0 votes
1 answer
42 views
Cannot connect to SSH via public key to specific user
On my server I have user ruslan and I manually created user git. I added to this user's .ssh/authorized_keys my public key. And I can connect via public key to user ruslan but can't to user git. ...
0 votes
2 answers
303 views
How to set environment variable into ssh session without using SendEnv?
We have a shared user account for administrative stuff. I want to use an env var to hold the initiant of the ssh session, so that the .bashrc can do user-dependent execution. I have tried -o SendEnv. ...
4 votes
1 answer
683 views
How to distinguish sftp session in PAM?
I installed Debian 13 and lastlog2 to see when someone last logged in. Unfortunately, changes in Debian 13 mean that, unlike before, sftp logins are also included in the lastlog database. My goal is ...
0 votes
0 answers
90 views
why do my ssh connections keep timing out with `mux_client_request_session`?
I’ve been running into a frustrating issue with SSH connections lately and could use some advice or insight. When I SSH into a few of our servers, the connection drops with an error like: ...
0 votes
0 answers
118 views
SSH (sometimes) hangs before logging in
I have a ssh server running (OpenSSH_9.9p2, OpenSSL 3.0.16 from freebsd, UseDNS set to no), but I sometimes randomly have issues logging in. As in, ssh doesn't even get to the auth state. What could ...
0 votes
0 answers
143 views
smokeping: remote fping graph not updated
I'm running smokeping on my gateway. For direct pings (started from the gateway itself) all graphs work fine. They contain data. Yet if I use the RemoteFPing probe, the graphs stay empty (I waited a ...
0 votes
0 answers
121 views
fail2ban replacement for server behind NAT
I have a server with sshd running behind NAT(port forwarded via iptables through another server). All ssh connections from outside shown as connection from forwarding server IP. So fail2ban won't ...
0 votes
1 answer
64 views
SSHD drops connection after first successful login
I have an issue with sshd and connection drops. I can successfully ssh from my laptop to my cloud server once. After disconnecting and reconnecting my ssh logins are dropped. The only way to make it ...
1 vote
0 answers
72 views
SSH Python Script to Windows Server Connection
I am trying to connect to a Windows Server using SSH in a python script. I am able to connect with my username and password, but connecting with an SSH key fails with: Check username, key file path, ...
1 vote
1 answer
94 views
multiple login methods sshd_config
I have several Linux servers. Most are configured to only accept logins with SSH keys, but for some servers, I need to be able to log in with both key and user/pass. The problem is that users who use ...
4 votes
1 answer
273 views
Understanding the ChallengeResponseAuthentication setting with PAM and login.conf
When using ChallengeResponseAuthentication, it is important to understand how it interacts with the Pluggable Authentication Modules (PAM) system and related configuration files. When ...
4 votes
1 answer
426 views
How to generate reproducible ssh key?
I want to set up a local docker dev environment for ansible (semaphore ui container) and a dev docker container for testing tasks. To avoid storing the ssh key somewhere I thought I create a ...
1 vote
1 answer
153 views
Make a chain (Port forwarding) of local open ssh ports and open after on a new port
I have to to ssh connections (connected via ssh to two seperate servers) bind with option -D to port 1080 and 1081 on localhost. Now I want to make a chain so that the traffic first routes to port ...
1 vote
1 answer
58 views
ssh key login does not work after enabling DISA STIGs
After enabling the STIGs, SSH keys have stopped working. You present the key and it still asks for a password. Things I've tried: Confirmed I'm using RSA with SHA2 which is accepted Confirmed that ...
3 votes
1 answer
211 views
How can I troubleshoot a systemd socket not connecting to ssh?
I have a user data script that changes the SSH port on an EC2 machine to 9000 to make way for a podman bastion container on port 22. This worked fine for several months, until today when it didn't. ...
0 votes
1 answer
361 views
ansible ssh remote login failing to google compute engine VM
Just starting to work with ansible. I have a private ssh key on my local system, and a public ssh key in ~/.ssh/authorized_keys on the remote host. For test purposes, I have set the following ...
1 vote
0 answers
57 views
Can't figure out the good ssh config via a jump host (ProxyJump) with private key only on the jump host
ASCII representation of the workflow [Local Machine] | | SSH ProxyJump / ProxyCommand v ----------------- | Jump Host | <- Private key here | xxx | ------...
0 votes
0 answers
37 views
How to implement timeout in sftp client using libssh?
I am developing an sftp client using blocking calls of libssh library. With libssh, there is an option to set connection timeout using SSH_OPTIONS_TIMEOUT. But documentations has no reference on how ...
7 votes
4 answers
2k views
Industry standard for EC2 instance (server) shell access
I have set up an EC2 instance and use SSH on port 22 with SSH key. And I'd like to know how this is done in a "professional" way. Is this the preferred way of gaining shell access to a ...
0 votes
1 answer
245 views
How to configure SSH with PAM to require TOTP only for publickey logins, but allow password-only login without OTP?
I’m configuring a Linux server with OpenSSH and pam_google_authenticator.so for TOTP-based 2FA. I want to enforce different authentication paths based on the login method: If a user logs in using ...
0 votes
0 answers
67 views
Connect PyCharm to a Redhat server behind a Redhat bastion
PyCharm supports remote development through ssh, which comes in very handy for me (training LLMs on GPU clusters). I've been using the feature for a long time, but now I need to use a Redhat server, ...
0 votes
1 answer
73 views
How to add SSH `-o` options to Ruby’s tty-command?
I have a site on an older version of Debian (update pending for various reasons). To log in to the server on the command-line I needed to add rsa key options to my SSH "config" file: Host ...
0 votes
1 answer
357 views
How to make ssh work in a container without --privileged=true is passed to podman?
I am starting ssh/sftp in a container. sftp after getting authenticated is disconnecting. It stater only working when I pass --priveleged=true. podman run --privileged=true -dit -p 3333:3333 ...
0 votes
1 answer
185 views
What could be the reason for sftp client closing connection?
sftp client closing client after authentication . debug2: channel_input_open_confirmation: channel 0: callback done debug2: channel 0: open confirm rwindow 0 rmax 32768 debug3: send packet: type 1 ...
0 votes
0 answers
97 views
How to backup local system to a remote machine via ssh?
How do I use rsnapshot to backup my local system to a network machine to which I can ssh via ssh me@backupmachine? I edited /etc/rsnapshot.conf but no luck: I tried to set snapshot_root me@...
1 vote
1 answer
217 views
SSH items with kex algorithms mismatch
Zabbix 7.2 OS Oracle Linux 9.6 I have a legacy switch that is monitored by a Zabbix Proxy and has SSH items configured. However, the SSH items are unable to reach the host due to a mismatch in Kex ...
0 votes
1 answer
79 views
sshd setting `AcceptEnv HOME` doesn't seem to work
I ssh into a running Docker container. This container has mounted home directory (/home/username) to an NFS partition, shared between several users of other similar containers. All these containers ...
0 votes
1 answer
91 views
linux force command script that is like NOT having a force command script
When SSH sessions are started, I need to log information that is in the environment passed to SSH, so I cannot do the logging during PAM. My basic script does not show PAM output (eg MOTD) which is ...
0 votes
1 answer
84 views
SSH getting intermittently disconnected
I'm connecting from Windows 11 to Amazon Linux 2023 using SSH. I'm getting intermitted disconnections. I tried adding the following to the sshd_config: ClientAliveInterval 300 ClientAliveCountMax 3 ...
0 votes
0 answers
124 views
How to ssh to podman container through another podman container
I am trying to learn ansible locally by recreating server-node scenario using podman containers on basis of this article: https://naveenkumarjains.medium.com/ansible-setup-on-containers-4d3b3efc13ea ...
0 votes
1 answer
415 views
rsync over legacy SSH server: error in rsync protocol data stream (code 12) at io.c(232) [Receiver=3.2.7]
I'm planning for a transfer over 3TB and I can't work my way with rsync rsync -av -e 'ssh -p 2222' [email protected]:/volume1/video/ ./ [email protected]'s password: Permission denied, please try again....
0 votes
0 answers
102 views
pfsense drops ssh connection after 1 minute
I have a primary pfsense (192.168.139.1) and a second pfsense (192.168.139.90 on this interface) that has a LAN network behind it (192.168.100.1 on the other interface). My machines on the secondary ...
0 votes
0 answers
62 views
ssh connection error (ssh_config attached)
(base) haohao@zhangjunhaodebijixingdiannao .ssh % sudo ssh [email protected] -v OpenSSH_9.9p1, LibreSSL 3.3.6 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: ...
0 votes
0 answers
35 views
After installing SELinux on AWS instance what should I set to allow SSH login?
Question After installing SELinux on an AWS instance what should I set to allow SSH login? Version Ubuntu 24.04 LTS. Background I had a brand new, working AWS instance but after I installed SELinux ...
0 votes
1 answer
146 views
fail2ban: IP "already banned" but IP is not in iptables?
I'm using the asterisk and sshd jails in jail.local. The asterisk-related banning works fine, but when I added the sshd jail, it seems to be having issues: it recognizes the ssh failures, and "...
0 votes
1 answer
102 views
VS Code Bypasses OpenSSH Server Configuration
I am using an Ubuntu 24.04 server with OpenSSH. The /etc/ssh/sshd_config uses the following options: PermitRootLogin no PubkeyAuthentication yes PasswordAuthentication no KbdInteractiveAuthentication ...
0 votes
0 answers
174 views
sshd stops accepting connections after a few minutes – requires manual restart
I'm facing a strange issue with sshd on my server. I have a custom SSH service running (custom-sshd.service) on a non-standard port. Every time I reboot or manually restart the service using: sudo ...
0 votes
0 answers
35 views
Up-to-date process [duplicate]
on my Debian server, I noticed that I have this up-to-date process that takes a lot of memory, and I don't know what it does. So using top command I get this processes top - 10:45:46 up 4 days, 20:26, ...
0 votes
1 answer
132 views
What causes the ssh error "REMOTE HOST IDENTIFICATION HAS CHANGED" on connections with a port specifier (i.e not the default of 22)
I have migrated an old Amazon Linux server running OpenSSH_7.4p1, OpenSSL 1.0.2k-fips to a new Ubuntu 24 LTS box running OpenSSH_9.6p1 Ubuntu-3ubuntu13.11, OpenSSL 3.0.13. As part of the migration I ...
0 votes
1 answer
427 views
SSH and sudo extremely slow on first login/session, instant afterwards - all common causes ruled out
Summary of the issue I am experiencing a very long delay (~20–40 seconds) when opening a new SSH session or using sudo for the first time in a terminal on my Debian 11 system. Subsequent sudo commands ...
10 votes
2 answers
1k views
SSH key pair ONLY accepted by sshd in debug mode
Using Rocky 9.4, OpenSSH 8.7p1, I have an RSA keypair which is not accepted unless sshd is in debug mode. (Thankfully I have an old pair that works). I have unset SSH_AUTH_SOCK and verified that no ...
3 votes
3 answers
743 views
How can 10G link be slower to WAN than 1G link, on the same machine?
I'm using the following command to test network speed to my.remote.server, from my workstation: dd if=/dev/random | pv | ssh my.remote.server "dd of=/dev/null" When I set en0 to 10Gb, ...
3 votes
1 answer
246 views
ssh connection to all remote hosts, remote host reset connection after kex
I am on an Ubuntu 24.04.2 LTS client, and tried connecting to both a Debian 13 server and Linux Mint 22 server. I am using OpenSSH_9.6p1 Ubuntu-3ubuntu13.9, OpenSSL 3.0.13 30 Jan 2024 If I SSH with -...
0 votes
1 answer
460 views
How to set up git-http-backend with appropriate permissions to make repos also accessible via SSH
The situation: Debian12 host, apache2 httpd serving git CGI (located in /repos/git) for cloning repos. Repos are stored in /repos directory, and are owned by git user to enable ssh access to them (e.g....
0 votes
1 answer
110 views
turning off kex_exchange_identification log messages in sshd
I have a server running haproxy for ssh with server lo-01 lo-01:22 check inter 10s fall 2 rise 1 and then on lo-01 every 10s I get the following auth.log entries: Apr 2 17:04:55 lo-01 sshd[...
0 votes
1 answer
181 views
sshd: How to enable PAM authentication for groups with special secret location
I want to use google authentication and have a special secret path in the PAM module for user groups. I'm probably missing something like: If the user is in groupx, use alternative OTP file path. I ...
0 votes
1 answer
196 views
Password Conflict in Microstack Instance on Oracle VM: Unable to SSH Access
I am working on a project involving Microstack (OpenStack) where I am testing it on Oracle VM. I successfully created an instance, but I am encountering an issue: the instance prompts me for a ...