Can someone tell me where is located the log file for vsftpd? I'm trying to learn how to install and configure a ftp server and I can't seem to find the log file. Can anybody tell me how to configure the service to make a log file or where is located?
Ubuntu – vsftpd log file location
ftpvsftpd
Related Solutions
I would recommend remove (purging) your vsftp install and then reinstalling it with default conf files and starting the service and confirming it is running. I think you have a bad conf file that is causing it not to run properly.
Server side
Check service status
sudo service vsftpd status
Check its running processes
ps ax | grep vsftpd
(Command to: list all processes then filter output for vsftpd line)
or you can use a loop to monitor its processes:
while sleep 1 ; do clear ; ps ax | grep vsftpd ; done
(Command to: wait 1 second, clear shell screen, list all processes then filter output for vsftpd line, loop again as sleep always return succefully)
Check port status related to vsftpd process
netstat -lnp | grep vsftpd
(Command to: list all listening ports with port number and process id (PID) owning it then filter output for vsftpd line)
Monitor server log (
tail
with-f
to follow log updates and monitor vsftpd)$ tail -f /var/log/vsftpd.log Fri Apr 25 18:43:28 2014 [pid 2026] CONNECT: Client "127.0.0.1" Fri Apr 25 18:45:01 2014 [pid 2025] [sneetsher] OK LOGIN: Client "127.0.0.1"
Client side
(note: I run them from server just to make examples, prefer other host to check firewall settings...)
ftp
command with-v
verbose option to show all responses from the remote server)$ ftp -v localhost Connected to localhost. 220 (vsFTPd 3.0.2) Name (localhost:sneetsher): 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp>
FileZilla. It has very detailed log, but it sends couple commands depending on settings which not always what you want.
Status: Resolving address of localhost Status: Connecting to 127.0.0.1:21... Status: Connection established, waiting for welcome message... Response: 220 (vsFTPd 3.0.2) Command: USER sneetsher Response: 331 Please specify the password. Command: PASS ******** Response: 230 Login successful. Command: SYST Response: 215 UNIX Type: L8 Command: FEAT Response: 211-Features: Response: EPRT Response: EPSV Response: MDTM Response: PASV Response: REST STREAM Response: SIZE Response: TVFS Response: UTF8 Response: 211 End Command: OPTS UTF8 ON Response: 200 Always in UTF8 mode. Status: Connected Status: Retrieving directory listing... Command: PWD Response: 257 "/home/sneetsher" Command: TYPE I Response: 200 Switching to Binary mode. Command: PASV Response: 227 Entering Passive Mode (127,0,0,1,159,231). Command: LIST Response: 150 Here comes the directory listing. Response: 226 Directory send OK. Status: Calculating timezone offset of server... Command: MDTM 0000_12.04~ Response: 213 20140208184211 Status: Timezone offsets: Server: 0 seconds. Local: 0 seconds. Difference: 0 seconds. Status: Directory listing successful ... Status: Sending keep-alive command Command: TYPE I Response: 200 Switching to Binary mode.
Possible testing workflow
Server side: After changing
vsftpd.conf
, restart service (no need to reboot VBox guest)sudo service vsftpd restart
Client side: It's possible to write FTP client scripts (routine tests) using
yafc
. Example to upload a folder:#!/bin/bash yafc <<** open ftp://username:password@hostname put -f -r folder close ** exit 0
or using
ftp
:#!/bin/sh HOST='ftp.users.qwest.net' USER='yourid' PASSWD='yourpw' FILE='file.txt' ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD put $FILE quit END_SCRIPT exit 0
Server/Client on VirtualBox guests
Client should be in same NAT Network, Internal Network with server.
Or if Server has Bridged Adapter, Client could be set with NAT, NAT Network, Bridged Adapter.
References:
Best Answer
The log file for Ubuntu by default is
/var/log/vsftpd.log
. The setting is in/etc/vsftpd.conf
The default could be modified by specifying a different pathname (
/etc/vsftp.conf
entry):