Presence of sshd_config mandatory

Bug #1834129 reported by Luke A. Perkins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openssh (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

OpenSSH 7.9p1
Ubuntu 18..04.2 (LTS)

If a sshd daemon is started with a "-f my_sshd_config" command-line specification the sshd process still requires the existence of the sshd_config. The bug is somewhere in one of the forked processes started when an external client attempts a connection. Since the sshd_config file does not exists, an external client connection cannot be started.

Solution: If I "touch /etc/ssh/sshd_config" then the lock-up issue goes away and I am successfully able to login.

Bug: If the sshd configuration file is specified in the command line execution of the daeomon, then this should be the only file that should be required.

Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Luke, thanks for reporting this issue. Unfortunately, I am not able to reproduce it.

Ubuntu 18.04.2 ships openssh-server 1:7.6p1-4ubuntu0.3, not 7.9. Is the version typo'd in the report or are you running a self-installed version of openssh perhaps?

In any case, I attempted reproduction on both 18.04 (bionic) and 19.10 (eoan) in lxc, but was not able to reproduce a fault. If you could, please provide an exact set of commands to reproduce, and the error message you encountered. Please also verify you're running the stock distro version of openssh when doing - reproducing in a clean vanilla lxc instance or a fresh installation of ubuntu would be helpful.

$ lxc launch ubuntu:18.04/amd64 lp1834129
$ lxc exec lp1834129 bash
# apt-get update
[...]
# ps aux | grep sshd
root 685 0.0 0.0 72296 5660 ? Ss 22:31 0:00 /usr/sbin/sshd -D
root 687 0.0 0.0 14856 1008 ? S+ 22:31 0:00 grep --color=auto sshd
# service sshd stop
# ps aux | grep sshd
root 718 0.0 0.0 14856 1116 ? S+ 22:31 0:00 grep --color=auto sshd
# ls -l /run/ssh*
ls: cannot access '/run/ssh*': No such file or directory
# touch my_sshd_config
# sshd -f ./my_sshd_config
sshd re-exec requires execution with an absolute path
# /usr/sbin/sshd -f ./my_sshd_config
Missing privilege separation directory: /run/sshd
# mkdir /run/sshd
# /usr/sbin/sshd -f ./my_sshd_config
# ps aux | grep sshd
root 725 0.0 0.0 72296 3344 ? Ss 22:31 0:00 /usr/sbin/sshd -f ./my_sshd_config
root 727 0.0 0.0 14856 1040 ? S+ 22:31 0:00 grep --color=auto sshd
# kill 725
# !ps
ps aux | grep sshd
root 729 0.0 0.0 14856 1004 ? S+ 22:32 0:00 grep --color=auto sshd
# mv /etc/ssh/sshd_config /tmp/
# /usr/sbin/sshd -f ./my_sshd_config
# !ps
ps aux | grep sshd
root 732 0.0 0.0 72296 3200 ? Ss 22:32 0:00 /usr/sbin/sshd -f ./my_sshd_config
root 734 0.0 0.0 14856 1156 ? S+ 22:32 0:00 grep --color=auto sshd
# ls -l /etc/ssh/sshd_*
ls: cannot access '/etc/ssh/sshd_*': No such file or directory

# passwd ubuntu
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
# su ubuntu
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

$ ssh localhost
ubuntu@localhost's password:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
$ logout
Connection to localhost closed.

$ . /etc/lsb-release && echo ${DISTRIB_DESCRIPTION}
Ubuntu 18.04.2 LTS
$ ssh -V
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
$ apt-cache policy openssh-server | grep Installed
  Installed: 1:7.6p1-4ubuntu0.3

Changed in openssh (Ubuntu):
status: New → Incomplete
Revision history for this message
Luke A. Perkins (public-a) wrote :

I was able to confirm that this was not a bug. I did a fresh build of 18.04.2 LTS server, and it appears to work just fine.

My bad.

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Thanks for updating the bug! I'll close it now.

Changed in openssh (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.