Fix sftp access on CentOS machines
The sshd_config file that we put everywhere has an invalid value for where the sftp command is. On RedHat, it's in /usr/libexec - which means that it is not possible to use SFTP to interact with our CentOS machines. Replace the static file with a template so that we can substitute the correct value based on which distro it is. Change-Id: Ia9ba88199f4ff024a904431821926dbb26f35ad6
This commit is contained in:
parent
cd21635412
commit
110754ef24
@ -15,10 +15,7 @@ class ssh {
|
|||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
mode => '0444',
|
mode => '0444',
|
||||||
source => [
|
content => template('ssh/sshd_config.erb'),
|
||||||
"puppet:///modules/ssh/sshd_config.${::osfamily}",
|
|
||||||
'puppet:///modules/ssh/sshd_config',
|
|
||||||
],
|
|
||||||
replace => true,
|
replace => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,12 @@ class ssh::params {
|
|||||||
'RedHat': {
|
'RedHat': {
|
||||||
$package_name = 'openssh-server'
|
$package_name = 'openssh-server'
|
||||||
$service_name = 'sshd'
|
$service_name = 'sshd'
|
||||||
|
$sftp_path = '/usr/libexec/openssh/sftp-server'
|
||||||
}
|
}
|
||||||
'Debian': {
|
'Debian': {
|
||||||
$package_name = 'openssh-server'
|
$package_name = 'openssh-server'
|
||||||
$service_name = 'ssh'
|
$service_name = 'ssh'
|
||||||
|
$sftp_path = '/usr/lib/openssh/sftp-server'
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
fail("Unsupported osfamily: ${::osfamily} The 'ssh' module only supports osfamily Debian or RedHat (slaves only).")
|
fail("Unsupported osfamily: ${::osfamily} The 'ssh' module only supports osfamily Debian or RedHat (slaves only).")
|
||||||
|
@ -72,7 +72,7 @@ TCPKeepAlive yes
|
|||||||
# Allow client to pass locale environment variables
|
# Allow client to pass locale environment variables
|
||||||
AcceptEnv LANG LC_*
|
AcceptEnv LANG LC_*
|
||||||
|
|
||||||
Subsystem sftp /usr/lib/openssh/sftp-server
|
Subsystem sftp <%= scope.lookupvar('::ssh::params::sftp_path') %>
|
||||||
|
|
||||||
# Set this to 'yes' to enable PAM authentication, account processing,
|
# Set this to 'yes' to enable PAM authentication, account processing,
|
||||||
# and session processing. If this is enabled, PAM authentication will
|
# and session processing. If this is enabled, PAM authentication will
|
Loading…
Reference in New Issue
Block a user