twbsd.org
 
  Select Language: Home  SmbFTPD Forum 
SmbFTPD
Forum -> SmbFTPD
ver 2,7 smbftp.conf ?
GukChan -
I have found the smbftpd program while searching for ftp server programs that support UTF8 or force UTF8 conversion.
I think it is a very useful program.

Although non-English languages ​​have a lot of compatibility issues, this program is quite good for converting any ftp client to UTF8.

I downloaded and compiled the latest version 2.7 of the homepage. Your OS is centos 7.x.
The daemon also runs as smbftpd -D.

The -4 option is not recognized when looking at the log.

If you log in as ftp client, you will see 530 Login incorret error.

I have left the commented out because I do not use virtual users in smbftp.conf. In this case, we created a system user with useradd and confirmed it on passwd.
But why do not I see 530 Login incorrect when I enter my password after entering my account?

Does smbd.conf have a separate account-specific installation or is there a separate compile-time option?

Centos seems to involve Pam authentication.

Is there a pam-specific option at compile time? There is no mention in the manual.

Have a nice day...

或者在搜索已转换成UTF8知道smbftpd程序的FTP服务器程序被迫进入了UTF8支持。
我觉得一个非常有用的程序。

对于英语以外的其他语言,但有该程序的问题是相当兼容给出一个相当不错的FTP客户端,将其转变成UTF8以某种方式强迫。

下载网站的最新2.7版,我编译正在使用CentOS的7.x版操作系统。
它也将作为守护smbftpd -D运行。

然而-4选项不通过查看日志识别。

并与FTP客户端登录haebomyeon 530显示登录incorret错误。

我已经把smbftp.conf到底是什么,为什么你不使用虚拟用户评论。创建系统用户到passwd useradd的也已在此情况下识别。
为什么我不知道你登录到您的帐户,输入密码后,我输入账号,并显示530登录不正确。

如果有任何需要安装一个与smbd.conf或以其他方式编译时选项关联的独立帐户?

它似乎使用PAM认证CentOS是相关联的。

是否有一个编译时的选项PAM b慢?该名男子不提这给我们。

有一个愉快的一天......
Alex -
If you would like to use PAM/unix system user authentication, just don't set VirtualUserMapping and VirtualUserAuthMethod in the config file.

Just add a system user and make sure the user can login. You can enable debug log or log command to see why login fail.
GukChan -
Thank you for your reply. PAM did not work and eventually I logged in using smbftpd-user.
Synology also uses smbftpd, which is internally compiled by the vendor, and there are no files such as smbftpd.conf.

If you create it separately, it will not be able to open the file at all.

So we're testing it on CentOS now.

One more question.

If you look at the contents of the log file (/var/log/smbftpd.log)
Time is displayed in EST instead of system timezone (KST).

In this case, smbftpd.conf will need to be set separately from the date.

How do I fix it?

please answer about my question.

Thank you.
Alex -
Hi

For the time in log file, please check whether you set the timezone correctly in CentOS. The smbftpd use ctime() function to get the local time and put it int the log file. So it should be the same with system time zone.
GukChan -
Do I need to modify UTc?
It seems that UTc is currently affecting.
Local time and RTc are now local time.

Thanks you very much...

# timedatectl status
      Local time: Fri 2017-03-03 19:23:02 KST
  Universal time: Fri 2017-03-03 10:23:02 UTC
        RTC time: Fri 2017-03-03 19:23:28
       Time zone: Asia/Seoul (KST, +0900)
     NTP enabled: no
NTP synchronized: no
RTC in local TZ: yes
      DST active: n/a

Warning: The system is configured to read the RTC time in the local time zone.
         This mode can not be fully supported. It will create various problems
         with time zone changes and daylight saving time adjustments. The RTC
         time is never updated, it relies on external facilities to maintain it.
         If at all possible, use RTC in UTC by calling
         'timedatectl set-local-rtc 0'.
GukChan -
Fixed error with timedatectl set-local-rtc 0 command.
After modification, URC and RTC are the same.

When the file is transferred, the time stored in smbftpd.log is stored in UTC time instead of local time (KST).

What should I do in this case?

It seems that it should be saved by bringing in the local time KST time.
GukChan -
Is not it a bug? I do not seem to be getting the local time.
Or am I doing something wrong?

please answer about my question.

Thank you.
GukChan -
os version : centos 7.3.1611  3.10.0-514.6.1.el7.x86_64
GukChan -
Centos 6.x is supported, but 7.x does not.

Please confirm.

Thank you.
GukChan -
I mentioned in the last article above that "6.x is supported"
Version 6.x is not supported either.

It seems that centos is not supported. It is supported by the operating system (BSD) used for synology products.
GukChan -
A warning is issued at make. Is it because of this part?
C If you compile and run a source, the local time (KST) will be displayed normally.

Here is the test source.

#include <stdio.h>
#include <time.h>
#include <stdlib.h>

int main(){
        time_t _time;
        struct tm *ptm;
        char* chrtime;

        _time = time((time_t *)0);
        printf("time() : %ld\n",_time);

        ptm = gmtime(&_time);
        printf("gmtime() : %d.%d.%d %d:%d:%d\n",ptm->tm_year,ptm->tm_mon+1,ptm->tm_mday,ptm->tm_hour,ptm->tm_min,ptm->tm_sec);

        ptm = localtime(&_time);
        printf("localtime() : %d.%d.%d %d:%d:%d\n",ptm->tm_year,ptm->tm_mon+1,ptm->tm_mday,ptm->tm_hour,ptm->tm_min,ptm->tm_sec);

        _time = mktime(ptm);
        printf("mktime() : %ld\n",_time);

        chrtime = asctime(ptm);
        printf("asctime() : %s",chrtime);

        chrtime = ctime(&_time);
        printf("ctime() : %s",chrtime);

        return 0;

}

=======================================================

smbftpd source compile....


# ./configure --with-iconv
O_EXLOCK..............    [NO]
FD_COPY...............    [NO]
TCP Wrapper...........    [YES]
Have printflike.......    [NO]
pw_expire.............    [NO]
bsd glob..............    [NO]
user_from_uid.........    [NO]
Shadow passowd........    [YES]
Linux sendfile........    [YES]
Use PAM...............    [YES]
Check setproctitle....    [NO]
Check sin_len.........    [NO]
Check IPv6 support....    [YES]
Check iconv support ..    [YES]

Finished configure.

# make
===> auth
make -C auth
make[1]: Entering directory `/root/smbftpd-2.7/auth'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/auth'
<=== auth
===> restrict
make -C restrict
make[1]: Entering directory `/root/smbftpd-2.7/restrict'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/restrict'
<=== restrict
===> cmd
make -C cmd
make[1]: Entering directory `/root/smbftpd-2.7/cmd'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/cmd'
<=== cmd
===> ssl
make -C ssl
make[1]: Entering directory `/root/smbftpd-2.7/ssl'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/ssl'
<=== ssl
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include   -c -o misc.o misc.c
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include   -c -o param.o param.c
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include   -c -o reply.o reply.c
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include   -c -o log.o log.c
log.c: In function ‘smbftpd_logwtmp’:
log.c:163:2: warning: passing argument 1 of ‘gettimeofday’ from incompatible pointer type [enabled by default]
  gettimeofday(&ut.ut_tv, NULL);
  ^
In file included from /usr/include/utmpx.h:22:0,
                 from log.c:15:
/usr/include/sys/time.h:72:12: note: expected ‘struct timeval * __restrict__’ but argument is of type ‘struct <anonymous> *’
extern int gettimeofday (struct timeval *__restrict __tv,
            ^
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include   -c -o proctitle.o proctitle.c
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include   -c -o share.o share.c
cc -c -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include ftpcmd.c
ftpcmd.c:96:25: warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls]
#else
                         ^
ftpcmd.c:116:12: note: in expansion of macro ‘YYPARSE_DECL’

            ^
In file included from ftpcmd.y:76:0:
./include/smbftpd.h:219:5: note: previous declaration of ‘yyparse’ was here
int yyparse(void);
     ^
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include   -c -o main.o main.c
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include   -c -o pwcache.o pwcache.c
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include   -c -o oob.o oob.c
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include   -c -o unicode.o unicode.c
unicode.c: In function ‘smbftpd_codepage2unicode’:
unicode.c:90:2: warning: passing argument 2 of ‘iconv’ from incompatible pointer type [enabled by default]
  if (-1 == iconv(codepage2unicode, &inbuf, &inlen, &outbuf, &outlen)) {
  ^
In file included from unicode.c:13:0:
/usr/include/iconv.h:42:15: note: expected ‘char ** __restrict__’ but argument is of type ‘const char **’
extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,
               ^
unicode.c: In function ‘smbftpd_unicode2codepage’:
unicode.c:120:2: warning: passing argument 2 of ‘iconv’ from incompatible pointer type [enabled by default]
  if (-1 == iconv(unicode2codepage, &inbuf, &inlen, &outbuf, &outlen)) {
  ^
In file included from unicode.c:13:0:
/usr/include/iconv.h:42:15: note: expected ‘char ** __restrict__’ but argument is of type ‘const char **’
extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,
               ^
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include   -c -o textuser.o textuser.c
cc -o smbftpd misc.o param.o reply.o log.o proctitle.o share.o ftpcmd.o main.o pwcache.o oob.o unicode.o textuser.o -L./cmd -lcmd -L./restrict -lrestrict -L./auth -lauth -L./ssl -lftpssl -lcrypt -lwrap -lpam
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include -c smbftpd-user.c -o smbftpd-user.o
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include smbftpd-user.o -o smbftpd-user misc.o param.o share.o textuser.o unicode.o -L./auth -lauth -lcrypt -L./restrict -lrestrict -lwrap -lpam


# make install
===> auth
make -C auth
make[1]: Entering directory `/root/smbftpd-2.7/auth'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/auth'
<=== auth
===> restrict
make -C restrict
make[1]: Entering directory `/root/smbftpd-2.7/restrict'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/restrict'
<=== restrict
===> cmd
make -C cmd
make[1]: Entering directory `/root/smbftpd-2.7/cmd'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/cmd'
<=== cmd
===> ssl
make -C ssl
make[1]: Entering directory `/root/smbftpd-2.7/ssl'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/ssl'
<=== ssl
cc -o smbftpd misc.o param.o reply.o log.o proctitle.o share.o ftpcmd.o main.o pwcache.o oob.o unicode.o textuser.o -L./cmd -lcmd -L./restrict -lrestrict -L./auth -lauth -L./ssl -lftpssl -lcrypt -lwrap -lpam
[ -d /usr/local/bin ] || install -d /usr/local/bin
[ -d /usr/local/sbin ] || install -d /usr/local/sbin
[ -d /usr/local/etc/smbftpd ] || install -d /usr/local/etc/smbftpd
install -c -m 755 -s smbftpd /usr/local/sbin/
install -c -m 755 -s smbftpd-user /usr/local/bin/
install -d -m 755 /usr/local/etc/smbftpd/ssl.crt
install -d -m 755 /usr/local/etc/smbftpd/ssl.csr
install -d -m 755 /usr/local/etc/smbftpd/ssl.key
install -c -m 400 cert/conf/ssl.crt/ca.crt /usr/local/etc/smbftpd/ssl.crt/
install -c -m 400 cert/conf/ssl.crt/server.crt /usr/local/etc/smbftpd/ssl.crt/
install: cannot stat ‘cert/conf/ssl.crt/server.crt’: No such file or directory
install -c -m 400 cert/conf/ssl.csr/ca.csr /usr/local/etc/smbftpd/ssl.csr/
install -c -m 400 cert/conf/ssl.csr/server.csr /usr/local/etc/smbftpd/ssl.csr/
install: cannot stat ‘cert/conf/ssl.csr/server.csr’: No such file or directory
install -c -m 400 cert/conf/ssl.key/ca.key /usr/local/etc/smbftpd/ssl.key/
install -c -m 400 cert/conf/ssl.key/server.key /usr/local/etc/smbftpd/ssl.key/
Alex -
Would you please let me know which log file you are referring to?

Also show me some lines of the log. So I can check which log it is and what the problem might be.

Copyright © 2002-2024 Alex Wang from www.twbsd.org. All rights reserved.