[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#827550: vsftpd: when executing pam_exec on successfull login vsftp hangs and is not possible to transfer files



Hi Sean,

Sorry, there is no error message in the server form the vsftpd service.

Below you can find the information for both connections (with and without pam_exec), also add the information from the client, hope it help to fix this issue.

Regards,
António


This is the log when pam is used for login without calling pam_exec:

** Server log
Jun 20 11:01:03 cmdev vsftpd[12152]: pam_unix(vsftpd:session): session opened for user administrator by (uid=0)
Jun 20 11:01:03 cmdev vsftpd[12152]: [administrator] OK LOGIN: Client "192.168.8.1"
Jun 20 11:01:03 cmdev systemd-logind[552]: New session c85 of user administrator.
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response: Client "192.168.8.1", "230 Login successful."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP command: Client "192.168.8.1", "CWD /local"
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response: Client "192.168.8.1", "250 Directory successfully changed."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP command: Client "192.168.8.1", "TYPE A"
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response: Client "192.168.8.1", "200 Switching to ASCII mode."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP command: Client "192.168.8.1", "PASV"
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response: Client "192.168.8.1", "227 Entering Passive Mode (192,168,8,2,6,8)."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP command: Client "192.168.8.1", "STOR test.php"
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response: Client "192.168.8.1", "150 Ok to send data."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] OK UPLOAD: Client "192.168.8.1", "/local/test.php", 2683 bytes, 7616.62Kbyte/sec
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response: Client "192.168.8.1", "226 Transfer complete."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP command: Client "192.168.8.1", "TYPE I"
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response: Client "192.168.8.1", "200 Switching to Binary mode."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP command: Client "192.168.8.1", "PASV"
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response: Client "192.168.8.1", "227 Entering Passive Mode (192,168,8,2,4,86)."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP command: Client "192.168.8.1", "LIST -a"
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response: Client "192.168.8.1", "150 Here comes the directory listing."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response: Client "192.168.8.1", "226 Directory send OK."


** client log

Status:    Connecting to 192.168.8.2:21...
Status:    Connection established, waiting for welcome message...
Response:    220 Welcome to Commsmundi FTP server
Command:    USER administrator
Response:    331 Please specify the password.
Command:    PASS **********
Response:    230 Login successful.
Status:    Server does not support non-ASCII characters.
Status:    Connected
Status:    Starting upload of /home/antonio/Desktop/test.php
Command:    CWD /local
Response:    250 Directory successfully changed.
Command:    TYPE A
Response:    200 Switching to ASCII mode.
Command:    PASV
Response:    227 Entering Passive Mode (192,168,8,2,6,8).
Command:    STOR test.php
Response:    150 Ok to send data.
Response:    226 Transfer complete.
Status:    File transfer successful, transferred 2,683 bytes in 1 second




This is the log with pam_exec enabled (error transferring data):

** Server log
Jun 20 11:02:07 cmdev vsftpd[25478]: pam_exec(vsftpd:auth): Calling /tmp/test.sh ...
Jun 20 11:02:07 cmdev vsftpd[25476]: pam_unix(vsftpd:session): session opened for user administrator by (uid=0)
Jun 20 11:02:07 cmdev vsftpd[25476]: [administrator] OK LOGIN: Client "192.168.8.1"
Jun 20 11:02:07 cmdev systemd-logind[552]: New session c87 of user administrator.
Jun 20 11:02:07 cmdev vsftpd[25479]: [administrator] FTP response: Client "192.168.8.1", "230 Login successful."
Jun 20 11:02:07 cmdev vsftpd[25479]: [administrator] FTP command: Client "192.168.8.1", "CWD /local"
Jun 20 11:02:07 cmdev vsftpd[25479]: [administrator] FTP response: Client "192.168.8.1", "250 Directory successfully changed."
Jun 20 11:02:08 cmdev vsftpd[25479]: [administrator] FTP command: Client "192.168.8.1", "TYPE A"
Jun 20 11:02:08 cmdev vsftpd[25479]: [administrator] FTP response: Client "192.168.8.1", "200 Switching to ASCII mode."
Jun 20 11:02:08 cmdev vsftpd[25479]: [administrator] FTP command: Client "192.168.8.1", "PASV"


The pam_exec script is executed, "auth    optional    pam_exec.so debug seteuid log=/tmp/pam_exec.log /tmp/test.sh", in the log i see:

*** Mon Jun 20 11:02:07 2016
administrator



** client log
Status:    Connecting to 192.168.8.2:21...
Status:    Connection established, waiting for welcome message...
Response:    220 Welcome to Commsmundi FTP server
Command:    USER administrator
Response:    331 Please specify the password.
Command:    PASS **********
Response:    230 Login successful.
Status:    Server does not support non-ASCII characters.
Status:    Connected
Status:    Starting upload of /home/antonio/Desktop/test.php
Command:    CWD /local
Response:    250 Directory successfully changed.
Command:    TYPE A
Response:    200 Switching to ASCII mode.
Command:    PASV
Error:    Connection timed out
Error:    File transfer failed



On 06/19/2016 08:28 AM, Sean Whitton wrote:
control: tag -1 +moreinfo
control: merge 827550 827551

Dear Antonio,

Thank you for your bug report.

As it stands you have not provided enough information for a Debian
contributor to investigate the problem.  Could you provide a log
including the error?

Thanks.


-- 

Saludos / Regards / Cumprimentos,
António silva

Reply to: