LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-17-2013, 12:02 PM   #1
shazgaurav
LQ Newbie
 
Registered: Apr 2013
Posts: 29

Rep: Reputation: Disabled
lftp issue


I installed lftp in remote machine over kvm with ip 192.168.100.230 and tried to connect other machine over same network 192.168.100.193.I was able to as I could see the prompt but I could not execute any command as it would say "delaying before reconnect"and would never connect(screenshot)
Attached Thumbnails
Click image for larger version

Name:	lftp prob.png
Views:	27
Size:	205.5 KB
ID:	14245  
 
Old 12-17-2013, 09:18 PM   #2
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,687

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Quote:
Originally Posted by shazgaurav View Post
I installed lftp in remote machine over kvm with ip 192.168.100.230 and tried to connect other machine over same network 192.168.100.193.I was able to as I could see the prompt but I could not execute any command as it would say "delaying before reconnect"and would never connect(screenshot)
You have no network or firewall problems, and the server is running, as you are obviously able to connect to it. What ftp software is on ...193, and what do you find in its log files?
 
Old 12-17-2013, 10:24 PM   #3
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
Please Get us the logs first, then only i could make any comment.
 
Old 12-17-2013, 10:40 PM   #4
shazgaurav
LQ Newbie
 
Registered: Apr 2013
Posts: 29

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
You have no network or firewall problems, and the server is running, as you are obviously able to connect to it. What ftp software is on ...193, and what do you find in its log files?
I donot find log files being updated in 192.168.100.193 but there is certainly something that comes up on 230 in /var/log/messages.As I am a newbie I donot know what it is and if it is something related to lftp(screenshot).I have installed vsftp on 193.
Attached Thumbnails
Click image for larger version

Name:	lftp1.png
Views:	25
Size:	198.1 KB
ID:	14255  
 
Old 12-17-2013, 11:03 PM   #5
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,687

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Quote:
Originally Posted by shazgaurav View Post
I donot find log files being updated in 192.168.100.193 but there is certainly something that comes up on 230 in /var/log/messages.As I am a newbie I donot know what it is and if it is something related to lftp(screenshot).I have installed vsftp on 193.
This is about DHCP, not FTP.

Since you mention KVM, I guess you are running Red Hat or a Red Hat clone like Centos. Let us know if I am wrong. If I am right, the default FTP server is therefore vsftpd.

To double-check, as root run netstat -lnp|grep ':21' on 192.168.100.193. Do you see the vsftpd?

If yes, check the configuration file /etc/vsftpd/vsftpd.conf on 192.168.100.193. Do you find these lines:
xferlog_enable=YES
xferlog_std_format=YES
(they should be there by default)
In the same configuration file, what is the value of xferlog_file? This is the log file you need to look at.

If you play around with virtual machines on a Linux system, I suggest you acquire a minimum of system administration skills. http://www.linuxquestions.org/questi...ks-4175433508/ has a few suggestions (don't start with Linux from Scratch, though).
 
Old 12-18-2013, 12:14 AM   #6
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
Just had the look onthe attached logs screenshot, it never got connected to the ftp.

Can you share the FTP logs to us ?
 
Old 12-18-2013, 12:16 AM   #7
shazgaurav
LQ Newbie
 
Registered: Apr 2013
Posts: 29

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by berndbausch View Post
This is about DHCP, not FTP.

Since you mention KVM, I guess you are running Red Hat or a Red Hat clone like Centos. Let us know if I am wrong. If I am right, the default FTP server is therefore vsftpd.

To double-check, as root run netstat -lnp|grep ':21' on 192.168.100.193. Do you see the vsftpd?

If yes, check the configuration file /etc/vsftpd/vsftpd.conf on 192.168.100.193. Do you find these lines:
xferlog_enable=YES
xferlog_std_format=YES
(they should be there by default)
In the same configuration file, what is the value of xferlog_file? This is the log file you need to look at.

If you play around with virtual machines on a Linux system, I suggest you acquire a minimum of system administration skills. http://www.linuxquestions.org/questi...ks-4175433508/ has a few suggestions (don't start with Linux from Scratch, though).

I do find /etc/vsftpd/vsftpd.conf and it does contain
xferlog_enable=YES
xferlog_std_format=YES
but I find the
xferlog_file commented out(has # before it)screenshot.

And as far as books are concerned,a big thanx to your.Novice users like me need such links.
Attached Thumbnails
Click image for larger version

Name:	xferlog_file.png
Views:	15
Size:	100.3 KB
ID:	14259  
 
Old 12-18-2013, 12:46 AM   #8
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,687

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Quote:
Originally Posted by shazgaurav View Post
I do find /etc/vsftpd/vsftpd.conf and it does contain
xferlog_enable=YES
xferlog_std_format=YES
but I find the
xferlog_file commented out(has # before it)screenshot.
Then the log file is the default, /var/log/xferlog.

Now, I did think that you could connect, but as SAbhi says, this may not be the case. Typically there are two obstacles:
  • the firewall blocks the FTP port 21
  • the FTP server is not running
To check the first question, run iptables -S INPUT as root on the server. If the port is closed, you can open it with iptables -I INPUT 1 -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT, or perhaps you have a GUI and a firewall tool under the System menu that you can use instead (better).

To check the second question, again as root, run service vsftpd status. If it is not running, service vsftpd start.
 
Old 12-18-2013, 01:25 AM   #9
shazgaurav
LQ Newbie
 
Registered: Apr 2013
Posts: 29

Original Poster
Rep: Reputation: Disabled
[root@server1 Desktop]# iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -m physdev --physdev-is-bridged -j ACCEPT
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
[root@server1 Desktop]# service vsftpd status
vsftpd (pid 1630) is running...


Still no luck
 
Old 12-18-2013, 02:37 AM   #10
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,687

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Quote:
Originally Posted by shazgaurav View Post
[root@server1 Desktop]# iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -m physdev --physdev-is-bridged -j ACCEPT
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
[root@server1 Desktop]# service vsftpd status
vsftpd (pid 1630) is running...


Still no luck
Hm.
Let's use a different ftp client. If you have telnet installed on the client system, do a telnet 192.168.100.193 21 and enter some text. If not, you can probably install it with a yum install telnet.

I was only partially correct regarding the vsftpd configuration parameters. The best setting is:
xferlog_enable=YES
xferlog_std_format=NO
This will create a useful log file /var/log/vsftpd.log, which contains both connection and disconnection attempts and file transfers.
So, change your configuration file and restart the daemon with service vsftpd restart. Then try to connect again, either using lftp or telnet, and have a look at /var/log/vsftpd.log. Here is what it looks like on my system:
Code:
Wed Dec 18 16:44:23 2013 [pid 25115] CONNECT: Client "192.168.115.2"
Wed Dec 18 16:44:29 2013 [pid 25114] [ftp] OK LOGIN: Client "192.168.115.2", anon password "sdfsdfsd"
Wed Dec 18 16:44:47 2013 [pid 25122] [ftp] OK DOWNLOAD: Client "192.168.115.2", "/pub/os/TRANS.TBL", 11414 bytes, 1024.12Kbyte/sec
Wed Dec 18 16:44:54 2013 [pid 25122] [ftp] OK DOWNLOAD: Client "192.168.115.2", "/pub/os/GPL", 18092 bytes, 1510.60Kbyte/sec

Last edited by berndbausch; 12-18-2013 at 02:50 AM.
 
Old 12-18-2013, 09:10 AM   #11
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
OP tried lftp to login and when we look at the logs:

Quote:
Wed Dec 18 16:44:23 2013 [pid 25115] CONNECT: Client "192.168.115.2"
Wed Dec 18 16:44:29 2013 [pid 25114] [ftp] OK LOGIN: Client "192.168.115.2", anon password "sdfsdfsd
"
This doesn't seems to be a firewall issue but a simple login issue, vsftp may not be correctly configured or user creation could be a issue.
how the vsftp is configured ? are you using virtual users or system users ?
can you paste the conf file here ?
Try logging in from the vsftpd first: ftp [ftp server]
provide username and password.
and see if you log in and if not fetch the logs and tell us what you see.

See my test machine has login like this:
Code:
[root@test ~]# ftp localhost
Connected to localhost.abhi.com.
220 Welcome to Abhi's Test FTP service.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): sam
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (127,0,0,1,173,156)
150 Here comes the directory listing.
226 Directory send OK.
ftp> bye
221 Goodbye.

 and when i connect from an external machine:

C:\Users\Test>ftp 192.168.80.128
Connected to 192.168.80.128.
220 Welcome to Abhi's Test FTP service.
User (192.168.80.128:(none)): sam
331 Please specify the password.
Password:
230 Login successful.
ftp>

Last edited by SAbhi; 12-18-2013 at 09:23 AM.
 
Old 12-18-2013, 11:04 AM   #12
mddnix
Member
 
Registered: Mar 2013
Location: Bangalore, India
Distribution: Redhat, Arch, Ubuntu
Posts: 512

Rep: Reputation: 139Reputation: 139
It seems you are unable to connect. Provide outputs for any following commands...
Code:
ping -c4 192.168.100.193
telnet 192.168.100.193 21
nmap -p 21 192.168.100.193
 
Old 12-18-2013, 12:44 PM   #13
shazgaurav
LQ Newbie
 
Registered: Apr 2013
Posts: 29

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by mddesai View Post
It seems you are unable to connect. Provide outputs for any following commands...
Code:
ping -c4 192.168.100.193
telnet 192.168.100.193 21
nmap -p 21 192.168.100.193
telnet 192.168.100.193 21
Trying 192.168.100.193...
telnet: connect to address 192.168.100.193: No route to host

[root@tester1 ~]# ping -c4 192.168.100.193
PING 192.168.100.193 (192.168.100.193) 56(84) bytes of data.
From 192.168.100.231 icmp_seq=2 Destination Host Unreachable
From 192.168.100.231 icmp_seq=3 Destination Host Unreachable
From 192.168.100.231 icmp_seq=4 Destination Host Unreachable

--- 192.168.100.193 ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 12999ms
pipe 3


yes indeed I am unable to connect.Please help me on this and let me know if some more info is req. from my end.
 
Old 12-18-2013, 01:38 PM   #14
mddnix
Member
 
Registered: Mar 2013
Location: Bangalore, India
Distribution: Redhat, Arch, Ubuntu
Posts: 512

Rep: Reputation: 139Reputation: 139
In KVM, have you created virtual network for subnet 192.168.100.0? You also need to select that virtual network in both virtual machines... See the screenshot.
Attached Thumbnails
Click image for larger version

Name:	con.png
Views:	15
Size:	39.8 KB
ID:	14262  
 
Old 12-18-2013, 01:58 PM   #15
shazgaurav
LQ Newbie
 
Registered: Apr 2013
Posts: 29

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by mddesai View Post
In KVM, have you created virtual network for subnet 192.168.100.0? You also need to select that virtual network in both virtual machines... See the screenshot.
yes I have selected it.(screenshot)
Attached Thumbnails
Click image for larger version

Name:	vm_selection.png
Views:	13
Size:	188.1 KB
ID:	14263  
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
regarding lftp santhosh-e Linux - Software 3 01-03-2012 10:22 AM
lftp mikeshn Linux - Software 11 07-20-2011 01:44 PM
Lftp help pls maceee Linux - Server 2 02-25-2009 03:33 AM
lftp HELP knappster Linux - Software 2 08-03-2004 11:34 AM
about lftp oskernel Linux - Software 1 10-29-2003 03:14 PM


All times are GMT -5. The time now is 08:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration