cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
1,677 Views
Registered: ‎06-18-2016

ftp not working in 2019 petalinux pre-built linux on Zynq zc706

Jump to solution

Hi All,
I have been using ftp to transfer files from the host to the zc706 board in petalinux 2017. This worked "out of the box". On the Zynq side the /var/ftp directory was present in the file system and that's where ftp file transfers went.
Using the same zc706 board but with petalinux 2019 (pre-built) there is no /var/ftp and when I attempt to ftp from my ubuntu machine I get this response:

ftpd: invalid option -- w

Nothing else in the system has changed except for switching to petalinux 2019. There is no firewall between the machines. telnet works.

I tried the following setup: Busybox and Busybox inetd are enabled in the rootfs config. As per forum advice, I have disabled openssh-sftp-server, ssh-server-dropbear and CONFIG-packagegroup-core-ssh-dropbear in the rootfs config. From the host machine, ps | grep inetd shows /usr/sbin/inetd. inetd.conf is the same across the petalinux versions.
When I attempt to ftp from my Windows system I get the same error message as above, but it proceeds to ask for a user name but closes after it is entered. Using Cygwin from the Windows system I get no error message, but it asks for a user name and closes after it is entered.

Can somebody tell me why ftp is no longer working in petalinux 2019?

Thanks,
Tom

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
1,571 Views
Registered: ‎06-18-2016

I have given up on getting the ftp to work, and am now using sftp.

Before using sftp I kill dropbear, then restart with only the -r argument:
/usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_host_key

In my case I also (on the linux host) run ssh-keygen -f "/home/tgs/.ssh/known_hosts" -R 192.168.1.3 (address of my target).

Cheers,
Tom

 

 

View solution in original post

0 Kudos
12 Replies
Highlighted
Moderator
Moderator
1,638 Views
Registered: ‎12-04-2016

Hi Tom

Can you try these commands. List the processes and kill the dropbear process:

# ps -ef

# kill -9 <pid>

Again run the dropbear command without -w appended

Example in my case: /usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_host_key -p 22

Then do ftp/ssh from host to target

 

Best Regards

Shabbir

0 Kudos
Highlighted
Adventurer
Adventurer
1,612 Views
Registered: ‎06-18-2016

Thanks for the quick response. I tried your suggestion and it makes no difference. When ftp'ing from host, still get:

ftpd: invalid option -w

If I get the ID of inetd and kill that, when I ftp I get 'connection refused', which is what I expect. When I restart inetd I again get the above response when I ftp. All tests above were done with the pre-built system.
I have a build that does not include dropbear and with that I also get the invalid option error above. The inclusion/exclusion of dropbear seems to have no effect on the invalid option error.
This could be relevant: Under petalinux 2017 (where ftp works) the directory /var/ftp appears on the target, but this directory is not present under petalinux 2019. So maybe between versions some other components needed for ftp were removed?

 

 

 

0 Kudos
Highlighted
Adventurer
Adventurer
1,598 Views
Registered: ‎06-18-2016

Some progress on my end, but no ftp uploads yet:

I found that removing the -w from the ftpd line in /etc/inetd.conf and restarting inetd allowed me to connect to the target using ftp. It appears that ftpd, when invoked from inetd.conf, does not accept the -w argument. When you run ftpd directly on the target the usage text tells you that the -w argument corresponds to allowing uploads. Replacing the -w with a -v works, so the problem is not that the invoked ftpd doesn't accept arguments.

There is only one executable ftpd in the target file system. When run directly both busybox ftpd and ftpd appear to be that executable.

inetd.conf is the same one as in petalinux 2017 but that version of petalinux didn't complain about the -w argument..

Currently (with -w removed from the ftpd line) I can connect with ftp and can download files from the target but not upload files to the target. The directory on the target has write permissions set. Since I can't set the -w option I can't tell if that's what is preventing the upload.

 

0 Kudos
Highlighted
Adventurer
Adventurer
1,572 Views
Registered: ‎06-18-2016

I have given up on getting the ftp to work, and am now using sftp.

Before using sftp I kill dropbear, then restart with only the -r argument:
/usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_host_key

In my case I also (on the linux host) run ssh-keygen -f "/home/tgs/.ssh/known_hosts" -R 192.168.1.3 (address of my target).

Cheers,
Tom

 

 

View solution in original post

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
1,390 Views
Registered: ‎05-11-2010

This seems to be problem of ftpd binary. I replace the /usr/sbin/ftpd binary with 2018.x one in 2019.1, and this issue disappeared.

Highlighted
Moderator
Moderator
1,352 Views
Registered: ‎12-04-2016

Hi @tgschneider 

Try running petalinux-config -c busybox -> Networking utilities -> ftpd -> [*] Enable -w option, and then ftpd should work as expected with -w option

 

Best Regards

Shabbir

Highlighted
Adventurer
Adventurer
1,303 Views
Registered: ‎06-18-2016

Thanks, I will try that.

0 Kudos
Highlighted
839 Views
Registered: ‎12-19-2017

Dear yzhang 

how can we done this job?

 

0 Kudos
Highlighted
834 Views
Registered: ‎12-19-2017
hi dear
how can we done this?
0 Kudos
Highlighted
833 Views
Registered: ‎12-19-2017
hi @yzhang
How can i do that?
0 Kudos
Highlighted
826 Views
Registered: ‎12-19-2017
hi @shabbrik
when i try do that i get error that petalinux can not extract busy-box source , how can i solve this issue
0 Kudos
Highlighted
Contributor
Contributor
485 Views
Registered: ‎06-08-2017

Hi,

on a Zynq 7000 Platform I could build a ftp connection:

 

This file /etc/inetd.conf to be changed:

 

from: ftp stream tcp nowait root ftpd ftpd -w

to: ftp stream tcp nowait root ftpd ftpd -w

 

And than restart the busybox ftpd process.

cd /etc/init.d
./inetd.busybox restart

 

Best Regards

0 Kudos