#836 Issue closed: openssh-server seems to be mandatory

Labels: enhancement, fixed / solved / done

EQXTFL opened issue at 2016-05-13 13:23:

  • rear version (/usr/sbin/rear -V):
    1.18
  • OS version (cat /etc/rear/os.conf or lsb_release -a):
    RHEL 6.5
  • rear configuration files (cat /etc/rear/site.conf or cat /etc/rear/local.conf):
    ISO/NFS
  • Brief description of the issue:
    Will hang after "creating root fs layout" if openssh-server is not installed. Only openssh-clients is listed as mandatory. Hanging process: "grep sftp".

Problem:
usr/share/rear/rescue/default/50_ssh.sh: read subsys sftp file junk < <( grep sftp /etc/sshd_co[n]fig /etc/ssh/sshd_co[n]fig /etc/openssh/sshd_co[n]fig 2>&8 )

Those files may not exist, in case a different SSH solution is used (e.g. CentrifySSH). You might want to add a check or make openssh-server the only supported SSH solution.

  • Work-around, if any:
    Install openssh-server

gdha commented at 2016-05-18 16:45:

@EQXTFL Seems weird you should see some messages like:

grep: /etc/sshd_co[n]fig: No such file or directory
grep: /etc/openssh/sshd_co[n]fig: No such file or directory

but it shouldn't hang. In case of Centrify - what are the file names?

EQXTFL commented at 2016-05-25 21:01:

Confirmed again - it just hangs. The file is here: /etc/centrifydc/ssh/sshd_config
Adding this to the related line in 50_ssh.sh fixes it.

gdha commented at 2016-06-07 15:14:

@EQXTFL Please verify if commit fixes your problem? Thank you for the feedback.

EQXTFL commented at 2016-06-20 21:58:

Confirmed fixed. Thanks!

schlomo commented at 2017-10-18 12:57:

@EQXTFL FYI, we are currently working on SSH (see #1500 and #1513 and the current master). Please kindly have a look if all those changes still work with your centrify setup.

EQXTFL commented at 2017-10-18 23:13:

Confirmed working, backup and restore. Thanks!

jsmeix commented at 2017-10-19 10:01:

@EQXTFL
I would expect that with current ReaR master code
CentrifySSH still works "out of the box" because in
current ReaR master code there is in
usr/share/rear/rescue/default/500_ssh.sh

copy_as_is_ssh_files=( /etc/ssh* /etc/openssh* /etc/centrifydc/ssh* /root/.s[s]h /root/.shos[t]s )

but see
https://github.com/rear/rear/pull/1530#issuecomment-337609631
and
https://github.com/rear/rear/pull/1538
where the latter changes that to

copy_as_is_ssh_files=( /etc/s[s]h /root/.s[s]h /root/.shos[t]s )

The funny [] around a letter makes 'shopt -s nullglob' (which is
set in usr/sbin/rear) remove this file from the list if it does not exist.

jsmeix commented at 2017-10-19 14:29:

With https://github.com/rear/rear/pull/1538 merged there is now
only support for OpenSSH 3.1 and later with its default directory
/etc/ssh/ for keys and config files and its default sshd config file
/etc/ssh/sshd_config for the SSH setup of the recovery system.
I removed support for non-standard directories
like /etc/openssh or non-standard sshd config files
like /etc/sshd_config or /etc/openssh/sshd_config.
I documented in the SSH_* section in default.conf
how to manually set up ReaR with a secure shell
software other than OpenSSH >= 3.1.
I removed the incomplete support for CentrifySSH
but did not make OpenSSH mandatory for ReaR
so that the initial problem in this issue here
does not re-appear (in particular not with SSH_FILES='no').

@EQXTFL
I would very much appreciate it if you could re-test
whether or not the newest GitHub master code
with https://github.com/rear/rear/pull/1538 merged
still works for your use case.
Many thanks in advance for your testing!

EQXTFL commented at 2017-10-27 17:24:

@jsmeix
Confirmed working - thanks!

jsmeix commented at 2017-11-06 12:25:

@EQXTFL
many thanks for your confirmation!
It helps (at least me) a lot to have an explicit feedback
when there is no (possibly obscure) regression in ReaR.


[Export of Github issue for rear/rear.]