SSH/SFTP connection error

First off, this appears to be a re-occurrence of an old problem

Second, it is not consistent

Third, it happens on both Ubuntu v20.04.1 and v18.04.5

The URL below is a ticket where it happened in the past, consistently, like clock work:

Below are the current software versions on the Ubuntu v18.04 server it is currently happening on:

Operating system Ubuntu Linux 18.04.5
Perl version 5.026001
Path to Perl /usr/bin/perl
BIND version 9.11
Postfix version 3.3.0
Mail injection command /usr/lib/sendmail -t
Apache version 2.4.29
PHP versions 7.2.33, 7.4.9
Webalizer version 2.23-08
Logrotate version 3.11.0
MySQL version 5.7.31-0ubuntu0.18.04.1
ProFTPD version 1.35
SpamAssassin version 3.4.2

THIS ISSUE IS FOR JAILED USERS (IT DOES NOT AFFECT NON JAILED USERS) (I am sorry, but I ALWAYS get asked if the problem is occurring outside of Jailed USERS)

I will summarize the issue a little from the old post.

When you create a Virtual Server, you can log into SSH/SFTP in a FTP program just fine or SSH (Via that Virtual Server's admin user) in putty just fine

When you create a new user under that virtual server (e-mail or FTP) , you become unable to log in via those methods as the Virtual Server admin

What is happening? Please be aware, this is not happening consistently 100%, out of 30 virtual servers it happened 4 times on Ubuntu v18.04 and 4 times on Ubuntu v20.04

below is not being saved correctly


in the following file:


This further causes the issue of /bin/bash being removed from the /etc/passwd file inside the user's jail the /home/chroot/domainid/

I created all the virtual servers first, then I started creating extra users, specifically an additional user for MySQL login access only (e-mail)

In another thread, Joe says there is a problem with the jails, I do not know if it is this issue he was speaking about, but this here is a bug ticket to track this better.

below is Joe's original response:

I do apologize that I only have a sample of 2, and on 2 different operating system versions, while I do not know if this happened on v20.04, the 1st jailed Virtual Server I created experienced the issue as well (I just found this out, since I looked at the /etc/webmin/virtual-server/domains/domain-id and the unjailed_shell=/bin/bash was missing from it, for the 1st user I don't create a MySQL user, so I did not notice any errors from it). Just to be aware, I did NOT create the host virtual server as apart of the 6.12 "Install Wizard" (last step)

I customized the Virtualmin settings, templates (enabling jails by default for new users) before I created my first user

I do hope this is enough information, good luck on fixing the issue.


P.S. This is just a report, I am already aware of what is happening and how to fix the issues that come up, All that I ask is that when this issue has been fixed in what version of Virtualmin the fix was applied to.



Yeah, it does look like unjailed_shell being missing from the domain file would cause the wrong shell to be set in /etc/passwd inside the jail.

Was this domain created with a jail enabled, or was it enabled afterwards?

I have jails enabled by default in the template, This is a fresh install of 18.04.5, all the software is up to date. I do wish I could predictably replicate it for you, that is why I reported it since You (Jamie) helped me with this issue back in 2018 on Ubuntu v16.04. That is the only reason I am familiar with it. If there is anything I can do to help test this for you, I will be happy to help in any way that I am capable of doing.

Good luck Jamie

I think I'd need remote access to a system that's seeing this problem in order to fully fix it.

As a work-around I will add an extra check to Virtualmin to handle this kind of failure, so at least you don't get a domain owner user with an invalid shell in /etc/passwd.

If you believe it will help you, I will provide a v20.04 server (technically since there are other issues going on on the 20.04, but will not get into that here, look at if you are interested in the other issues I point out with 20.04) to help you locate the problem. If you already know what the problem is, then I will be fine with these minor fixes until you release a total fix for this.

I am merely reporting a bug, but please do let me know if you would like access to one for you to try to reproduce it. Is this the same problem with the jails that Joe was talking about?

The one I will be providing access to, if you want, will be a test server, not a production server.

Yes, access to a server on which this issue can be reproduced would be really useful. Because Virtualmin runs on such a wide variety of systems, we often run into issues that can't be re-produced in our own tests.