NethServer Version: 7.3.1611
Module: ftp or sssd I would guess
GOAL:
I have two nethservers, both 7.3.1611. Server 1 (GR-100) is running the Samba4 domain, server 2 (GR-400) is used as file/ftp server. I want the file/ftp server to use the Samba4 AD accounts on Server 1.
The file/ftp server is already joined to the Samba4 domain, samba shares work fine with this configuration. I can use 'id ’ and I will get the proper info:
[root@gr-400 ~]# id someaccount
uid=1592401107(someaccount) gid=1592400513(domain users@domain.com) groups=1592400513(domain users@domain.com),1592401105(support@domain.com),1592401141(otrs_customers@domain.com),1592401120(otrs_agents@domain.com)
I used the documentation to alter the vsftpd config to be using system users by executing:
config setprop vsftpd UserType system
signal-event nethserver-vsftpd-save
I copied the /etc/pam.d/samba info into the /etc/pam.d/vsftpd file, which is the one referenced in the vsftpd.conf config file. This because no other config I could get my hands on, worked. Since the samba config should work, I would assume it would work for vsftpd too, but I am obviously making an error, as it doesnt work.
I also restored it to what it was, and played around, but no matter what I do, I can not get any results to show in the logs.
I have not yet touched the sssd.conf as the rest of the services seem to work fine with sssd.
Most general info I find, I can not make applicable for nethserver because I seem to miss some information that would make this gel.
Below are the relevant config files (I think).
/etc/pam.d/vsftpd
#%PAM-1.0
session optional pam_keyinit.so force revoke
auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
auth required pam_shells.so
auth include system-auth
account include system-auth
session required pam_loginuid.so
session include system-auth
/etc/sssd/sssd.conf
# ================= DO NOT MODIFY THIS FILE =================
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer’s guide, which is available
# at ://dev.nethesis.it/projects/nethserver/wiki/NethServer
# original work from .contribs.org/development/
#
# Copyright © 2013 Nethesis S.r.l.
# ://www.nethesis.it - support@nethesis.it
#
[sssd]
domains = domain.com, legacy
config_file_version = 2
services = nss, pam
debug_level=7
[pam]
debug_level=7
[domain/domain.com]
use_fully_qualified_names = True
id_provider = ad
access_provider = ad
ad_domain = domain.com
krb5_realm = domain.COM
krb5_store_password_if_offline = True
ldap_user_name = sAMAccountName
ldap_user_object_class = person
ldap_group_object_class = group
ldap_id_mapping = True
ad_maximum_machine_account_password_age = 0
cache_credentials = True
override_homedir = /var/lib/nethserver/home/%u
default_shell = /usr/libexec/openssh/sftp-server
realmd_tags = manages-system joined-with-samba
debug_level=7
[domain/legacy]
use_fully_qualified_names = False
id_provider = ad
access_provider = ad
ad_domain = domain.com
krb5_realm = domain.COM
krb5_store_password_if_offline = True
ldap_user_name = sAMAccountName
ldap_user_object_class = person
ldap_group_object_class = group
ldap_id_mapping = True
ad_maximum_machine_account_password_age = 0
cache_credentials = True
override_homedir = /var/lib/nethserver/home/%u
default_shell = /usr/libexec/openssh/sftp-server
debug_level=7
[nss]
debug_level=7
/etc/vsftpd/vsftpd.conf
# ================= DO NOT MODIFY THIS FILE =================
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer’s guide, which is available
# at ://dev.nethesis.it/projects/nethserver/wiki/NethServer
# original work from ://www.contribs.org/development/
#
# Copyright © 2013 Nethesis S.r.l.
# ://www.nethesis.it - support@nethesis.it
#
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd’s
# capabilities.
#
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd’s)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
anon_upload_enable=NO
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
# Uncomment this to allow local users to log in.
local_enable=YES
# specifies a home directory for each virtual user
user_sub_token=$USER
# Enable system users
pam_service_name=vsftpd
# Enable per-user configuration
user_config_dir=/etc/vsftpd/users
# Chroot all users
chmod_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
virtual_use_local_privs=YES
# Authentication
userlist_deny=NO
userlist_enable=YES
userlist_file=/etc/vsftpd/user_list
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# The target log file can be vsftpd_log_file or xferlog_file.
# This depends on setting xferlog_std_format parameter
xferlog_enable=YES
dual_log_enable=YES
log_ftp_protocol=NO
syslog_enable=NO
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
# connect_from_port_20=NO
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# The name of log file when xferlog_enable=YES and xferlog_std_format=YES
# WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log
#xferlog_file=/var/log/xferlog
#
# Switches between logging into vsftpd_log_file and xferlog_file files.
# NO writes to vsftpd_log_file, YES to xferlog_file
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
nopriv_user=ftp
hide_ids=YES
# allow access to users with writable home dir
allow_writeable_chroot=YES
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
listen_port=21
pasv_min_port=5500
pasv_max_port=5700
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES
tcp_wrappers=NO
rsa_cert_file=/etc/ssl/ftps/vsftpd.pem
rsa_private_key_file=/etc/ssl/ftps/vsftpd.pem
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
require_ssl_reuse=NO
ssl_ciphers=HIGH
All I see in the logs, is in the vsftpd log, and it tells me this:
Tue May 9 17:05:04 2017 [pid 1936] CONNECT: Client "192.168.50.38"
Tue May 9 17:05:05 2017 [pid 1936] DEBUG: Client “192.168.50.38”, “Connection terminated without SSL shutdown - buggy client?”
A ls -lrt on /var/log/sssd/ doesnt show any altered log files when I attempt to log on.
FileZilla shows this:
Status: Connecting to 172.16.1.50:21…
Status: Connection established, waiting for welcome message…
Response: 220 (vsFTPd 3.0.2)
Command: AUTH TLS
Response: 234 Proceed with negotiation.
Status: Initializing TLS…
Status: Verifying certificate…
Status: TLS connection established.
Command: USER user@domain.com
Response: 530 Permission denied.
Error: Could not connect to server
Any help would be greatly appreciated, I have been tearing my hair out for the last two days and about to give up and switch back to virtual users.
Wheeeeelp