Solved

conf file

Posted on 2011-03-20
38
640 Views
Last Modified: 2012-05-11
hi
how do i know which conf file the application is using in Linux?

i have an ftp program and 4 conf file in the system ,how do i know from which conf file the application is using ?
0
Comment
Question by:ywainberg
  • 18
  • 14
  • 4
  • +1
38 Comments
 
LVL 2

Expert Comment

by:sihar86
ID: 35174760
early question is what is your program ftp name?
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35174763
vsftpd

i get a connection refused now...
0
 
LVL 5

Expert Comment

by:paulqna
ID: 35174809
The man page from the ftp deamon will tell you how to specify which conf file it has to use when starting it manually.

The /etc/init.d/<ftpd name> script will show what will be used at system startup.

The "ps -ef|grep ftp" command will show running ftp processes with their commandline options, possibly it will also show the config file as commandline option.
0
 
LVL 2

Expert Comment

by:sihar86
ID: 35174820
make sure your firewall doesn't block your ftp connection
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35174836
nothing has change with firewall , i tried to change something in the configuration file and i might damage it ,and i don't know what seems to be the problem that i get connection refused
0
 
LVL 2

Expert Comment

by:sihar86
ID: 35174867
please check your vsftpd log.
by default vsftpd log located here /var/log/vsftpd.log.
put some vsftpd log content here
0
 
LVL 5

Expert Comment

by:paulqna
ID: 35174879
You should change your initial question as this is not what you want to know.
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35174883
there is only connection log raws ,login connect or login failed
0
 
LVL 2

Expert Comment

by:sihar86
ID: 35174890
please check your setting in part of
- userlist_enable
- userlist_deny
- userlist_file in vstpd.conf

http://vsftpd.beasts.org/vsftpd_conf.html
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35175124
Connect refused means your system is not running with ftp service. Make sure your system is running vsftpd service.

# ps -ef | grep -i ftp

or

# /ect/init.d/vsftpd status
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35175361
first of all you are correct ,it seems that mt vsftpd service un not running
the problem is that when i start the service /etc/init.d/vsftpd start ,is gives an output of starting ftp... but when i check status again it gives me that the service is not running
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35175375
Try to start the service and then please check the logs in /var/log/messages
If found something then please show us the output.
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35175409
nothing in the logs....
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35175443
If you have seen something in
 /var/log/vsftpd.log

Then please show us.

Without any error message we can't say anything.
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35175630
the log only shows that i manage to connect in the morning ,but no errors
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35175649
Could you please show us your conf file of vsftpd and highlight the changes which you have made.
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35178561
hi
i attached the conf file (just change the extension file type from .txt to .conf)

thanks
  vsftpd.txt
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35178601
Could you please show us output of:

# ls -la /etc/ssl/private/vsftpd.pem
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35178608
Also show us output of:

# ls -la /etc/vsftpd/
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 2

Author Comment

by:ywainberg
ID: 35178610
i don't have such a file in the /etc/ssl/private folder
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35178618
ok. Then comment below given line in your vsftpd.conf file ans start the service for vsftpd. It should work.

rsa_cert_file=/etc/ssl/private/vsftpd.pem

0
 
LVL 2

Author Comment

by:ywainberg
ID: 35178619
i don't have a folder vsftpd in  /etc
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35178626
Ok no problem just comment below given line in your vsftpd.conf file ans start the service for vsftpd. It should work.

rsa_cert_file=/etc/ssl/private/vsftpd.pem
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35178637
it seems that the command you send me passed through but i still don't have a vsftpd.pem in that folder
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35178653
Proble is you dont have file /etc/ssl/private/vsftpd.pem but in your vsftpd.conf you are trying to use that file and that is the reason, your vsftpd service is not getting start.

so open your vsftpd.conf file and find the line
rsa_cert_file=/etc/ssl/private/vsftpd.pem

in that file and just put # in front of that lin. Now save the file and close it and try to start the vsftpd service.
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35178664
did not work my friend
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35178671
Ok. Could you please show me directory listing of directory where you have kept your vsftpd.conf and also send me the file /etc/init.d/vsftpd.
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35178676
there are 3 files in the /etc folder : vsftpd.conf ,vsftpd.chroot_list ,vsftpd.userlist
 vsftpd
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35178971
show me output of.

# cat /etc/vsftpd.conf | grep -i rsa_cert_file

# ls -la /etc/vsftpd.conf
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35179089
#rsa_cert_file=/etc/ssl/private/vsftpd.pem

-rw-r--r-- 1 root root 5611 Mar 21 09:56 /etc/vsftpd.conf
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35179647
When you trying to start vsftpd service. What error you are getting in  /var/log/vsftpd.log

start the service:

# /etc/init.d/vsftpd start (to start the service)

# /etc/init.d/vsftpd status (to get the status of vsftpd service)

# tail -f /var/log/vsftpd.log

Also show the output of below given command.

# iptables -L -v


0
 
LVL 2

Author Comment

by:ywainberg
ID: 35179693
the service indicate starting but status shows it is not running

the log file doesn't show anything

ip tables output is in the attached file  
new-file
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35179983
Just disable the iptables and try to start th ftp service.

# iptables --flush

# /etc/init.d/iptables stop

# /etc/init.d/vsftpd start

# /etc/init.d/vsftpd status

and update us if you face any challenge.
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35180197
cant stop iptables , the system doesn't seems to know any file or service with the name iptables
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35180400
hi

i removed and installed the vsftpd server again and the service is now running

the problem is when i want to enter the ftp i get an error "500 OOPS: vsftpd: cannot locate user specified in 'ftp_username':ftp"
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35180476
i managed to make it work
i added to the conf file "ftp_username=nobody" and it paved the way

do you know how to restrict the ftp user only to a single folder?

when i log to the ftp i discovered that i can walk through the directories and not only the local user folder
0
 
LVL 12

Accepted Solution

by:
upanwar earned 250 total points
ID: 35180563
Open vsftpd configuration file - /etc/vsftpd/vsftpd.conf
# vi /etc/vsftpd/vsftpd.conf
Make sure following line exists (and uncommented):
chroot_local_user=YES
Save and close the file. Restart vsftpd.
# /etc/init.d/vsftpd restart

Now check and update.
0
 
LVL 2

Author Comment

by:ywainberg
ID: 35180680
thanks
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now