Can't SSH into Containers

ptmuldoon

Well-Known Member
Apr 28, 2012
36
2
48
I'm struggling to figure out why I cannot ssh into my ubuntu containers. I had thought I could in the past, but perhaps I never could or something changed.

I have sshd_config set to allow root access as follows "PermitRootLogin yes", yet can't log in.

I did notice that most of the config file is commented # out, so not sure I need to uncomment things or not.

and ssh is running.

Any helps is appreciated.
Thanks

Code:
root@PlexServer:/etc/ssh# systemctl status sshd
Failed to dump process list for 'ssh.service', ignoring: Input/output error
* ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2020-03-28 10:21:59 EDT; 36min ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 603 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
 Main PID: 605 (sshd)
    Tasks: 1 (limit: 4915)
   Memory: 1.4M
   CGroup: /system.slice/ssh.service

Mar 28 10:22:04 PlexServer sshd[621]: Received disconnect from 192.168.11.93 port 55999:11:  [preauth]
Mar 28 10:22:04 PlexServer sshd[621]: Disconnected from 192.168.11.93 port 55999 [preauth]
Mar 28 10:44:52 PlexServer sshd[685]: Received disconnect from 192.168.11.93 port 56820:11:  [preauth]
Mar 28 10:44:52 PlexServer sshd[685]: Disconnected from 192.168.11.93 port 56820 [preauth]
Mar 28 10:45:12 PlexServer sshd[687]: Received disconnect from 192.168.11.93 port 56821:11:  [preauth]
Mar 28 10:45:12 PlexServer sshd[687]: Disconnected from 192.168.11.93 port 56821 [preauth]
Mar 28 10:47:11 PlexServer sshd[694]: Received disconnect from 192.168.11.93 port 56851:11:  [preauth]
Mar 28 10:47:11 PlexServer sshd[694]: Disconnected from 192.168.11.93 port 56851 [preauth]
 
Last edited:
Your ssh-server part seems to be off ->

"Failed to dump process list for 'ssh.service', ignoring: Input/output error"

Please post sshd_config, especially:

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

And /etc/network/interfaces from Container and Host would be nice.

Also make systemctl restart sshd and post output from journalctl -x afterwards.
 
Ok, trying to provide as much infomation as I can. I cannot ssh into any of my containers, so I suspect it could be something at the host or other level.

On this particular (Plex) container.

I upgraded the distro from 18 to 19 yesterday. That did fix the that error when viewing the status, so that looks like this now:
Code:
root@PlexServer:/# systemctl status ssh
* ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-03-29 09:22:06 EDT; 6min ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 31453 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
 Main PID: 31454 (sshd)
    Tasks: 1 (limit: 4915)
   Memory: 1.5M
   CGroup: /system.slice/ssh.service
           `-31454 /usr/sbin/sshd -D

Mar 29 09:22:06 PlexServer systemd[1]: Starting OpenBSD Secure Shell server...
Mar 29 09:22:06 PlexServer sshd[31454]: Server listening on 0.0.0.0 port 22.
Mar 29 09:22:06 PlexServer sshd[31454]: Server listening on :: port 22.
Mar 29 09:22:06 PlexServer systemd[1]: Started OpenBSD Secure Shell server.
Mar 29 09:23:41 PlexServer sshd[31508]: Received disconnect from 192.168.11.93 port 53615:11:  [preauth]
Mar 29 09:23:41 PlexServer sshd[31508]: Disconnected from 192.168.11.93 port 53615 [preauth]
Mar 29 09:24:29 PlexServer sshd[31530]: Received disconnect from 192.168.11.93 port 53626:11:  [preauth]
Mar 29 09:24:29 PlexServer sshd[31530]: Disconnected from 192.168.11.93 port 53626 [preauth]

my sshd_config on container for those lines are commented out:

Code:
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

And after an ssh restart and attempt to connect, my journalctl looks like
Code:
Mar 29 08:57:01 PlexServer CRON[30760]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 29 08:57:01 PlexServer CRON[30761]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Mar 29 08:57:01 PlexServer CRON[30760]: pam_unix(cron:session): session closed for user root
Mar 29 09:22:06 PlexServer systemd[1]: Stopping OpenBSD Secure Shell server...
Mar 29 09:22:06 PlexServer sshd[30286]: Received signal 15; terminating.
Mar 29 09:22:06 PlexServer systemd[1]: ssh.service: Succeeded.
Mar 29 09:22:06 PlexServer systemd[1]: Stopped OpenBSD Secure Shell server.
Mar 29 09:22:06 PlexServer systemd[1]: Starting OpenBSD Secure Shell server...
Mar 29 09:22:06 PlexServer sshd[31454]: Server listening on 0.0.0.0 port 22.
Mar 29 09:22:06 PlexServer sshd[31454]: Server listening on :: port 22.
Mar 29 09:22:06 PlexServer systemd[1]: Started OpenBSD Secure Shell server.
Mar 29 09:23:41 PlexServer sshd[31508]: Received disconnect from 192.168.11.93 port 53615:11:  [preauth]
Mar 29 09:23:41 PlexServer sshd[31508]: Disconnected from 192.168.11.93 port 53615 [preauth]
Mar 29 09:24:29 PlexServer sshd[31530]: Received disconnect from 192.168.11.93 port 53626:11:  [preauth]
Mar 29 09:24:29 PlexServer sshd[31530]: Disconnected from 192.168.11.93 port 53626 [preauth]

My network interfaces on the container are also all commented out
Code:
# ifupdown has been replaced by netplan(5) on this system.  See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
#    sudo apt install ifupdown

And the network interfaces
Code:
auto lo
iface lo inet loopback

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.11.40
        netmask 255.255.255.0
        gateway 192.168.11.1
        bridge_ports eno1
        bridge_stp off
        bridge_fd 0

iface enp4s0 inet manual
 
please add " /etc/netplan" from within Container, thanks

BTW, sshd ist starting right now after update.
Did you do another try to login?
 
I added etc/netplan to interfaces on the container, but still no luck connecting after a reboot and ssh shows running.

I also created a new Ubuntu 19.10 container and can't connect to ssh either after enabling PermitRoot Login. I also noticed in 19.10, I do not even have a /etc/network/interfaces file.

And in all of my containers, the /etc/netplan directory is empty.

Not sure if that is all correct or something else is wrong somewhere.
 
gmed. Thank you for the help...... I think I just found that this has something to do with this Win10 laptop that I am using to connect to the containers.

I just used one of my Win10 VMs (in Proxmox) and ssh'd into my other containers just fine. So it must be something on this specific laptop that is killing the connection. Everything is on the same home network, and will have to trouble shoot what is stopping it on this particular machine.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!