Difference between revisions of "FTP"
From ArmadeusWiki
(New page: FTP (File Transfer Protocol) can easily be used on APF boards either to transfer some files from elsewhere (= as client) or to provide files to others (= as server). ==FTP client== <pre c...) |
m (→FTP server) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | FTP (File Transfer Protocol) can easily be used on APF | + | FTP (File Transfer Protocol) can easily be used on APF/OPOS modules, either to transfer some files from/to elsewhere (== as client) or to provide files to others (== as server). |
− | ==FTP client== | + | ==FTP as client== |
<pre class="apf"> | <pre class="apf"> | ||
# ftpget | # ftpget | ||
Line 7: | Line 7: | ||
</pre> | </pre> | ||
− | ==FTP server== | + | ==SFTP as client== |
+ | You will have to install OpenSSH package which provides ''sftp'' command: | ||
+ | <pre class="host"> | ||
+ | $ make menuconfig | ||
+ | </pre> | ||
+ | <pre class="config"> | ||
+ | Target packages ---> | ||
+ | ... | ||
+ | Networking applications ---> | ||
+ | ... | ||
+ | [*] openssh | ||
+ | </pre> | ||
+ | Reflash your rootfs, then: | ||
+ | <pre class="apf"> | ||
+ | # sftp -P 666 foo@server (666 is the SFTP port if not standard one) | ||
+ | </pre> | ||
+ | * For non interactive mode, use ''-b'' option with a batch file (https://linux.die.net/man/1/sftp). For example: | ||
+ | <pre class="apf"> | ||
+ | # cat > sftp.batch <<EOF | ||
+ | version | ||
+ | lcd /tmp | ||
+ | progress | ||
+ | get myfile.bin | ||
+ | bye | ||
+ | EOF | ||
+ | </pre> | ||
+ | * Non interactive mode requires you add a user (here ''foo'') matching the one on your server and generate/install SSH keys following [ | ||
+ | http://www.jscape.com/blog/setting-up-sftp-public-key-authentication-command-line this tutorial] | ||
+ | * Then: | ||
+ | <pre class="apf"> | ||
+ | # sftp -P 666 -b sftp.batch foo@server | ||
+ | </pre> | ||
+ | |||
+ | ==FTP as server== | ||
Buildroot propose [http://www.proftpd.org/ ProFTPD] as standard FTP server. You can add it to your rootfs with: | Buildroot propose [http://www.proftpd.org/ ProFTPD] as standard FTP server. You can add it to your rootfs with: | ||
<pre class="host"> | <pre class="host"> | ||
Line 13: | Line 46: | ||
</pre> | </pre> | ||
<pre class="config"> | <pre class="config"> | ||
− | + | Target packages ---> | |
− | [*] | + | ... |
+ | Networking applications ---> | ||
+ | ... | ||
+ | [*] proftpd | ||
</pre> | </pre> | ||
<pre class="host"> | <pre class="host"> | ||
− | $ | + | $ make |
</pre> | </pre> | ||
* then reflash your rootfs | * then reflash your rootfs | ||
Line 23: | Line 59: | ||
* you can configure the server with: ''/etc/proftpd.conf'' | * you can configure the server with: ''/etc/proftpd.conf'' | ||
− | [[Category:Network]] | + | ==Links== |
+ | [http://en.wikipedia.org/wiki/Ftp| Wikipedia FTP article] | ||
+ | |||
+ | [[Category:Network]][[Category:FTP]] |
Latest revision as of 19:20, 7 February 2018
FTP (File Transfer Protocol) can easily be used on APF/OPOS modules, either to transfer some files from/to elsewhere (== as client) or to provide files to others (== as server).
FTP as client
# ftpget # ftpput
SFTP as client
You will have to install OpenSSH package which provides sftp command:
$ make menuconfig
Target packages ---> ... Networking applications ---> ... [*] openssh
Reflash your rootfs, then:
# sftp -P 666 foo@server (666 is the SFTP port if not standard one)
- For non interactive mode, use -b option with a batch file (https://linux.die.net/man/1/sftp). For example:
# cat > sftp.batch <<EOF version lcd /tmp progress get myfile.bin bye EOF
- Non interactive mode requires you add a user (here foo) matching the one on your server and generate/install SSH keys following [
http://www.jscape.com/blog/setting-up-sftp-public-key-authentication-command-line this tutorial]
- Then:
# sftp -P 666 -b sftp.batch foo@server
FTP as server
Buildroot propose ProFTPD as standard FTP server. You can add it to your rootfs with:
$ make menuconfig
Target packages ---> ... Networking applications ---> ... [*] proftpd
$ make
- then reflash your rootfs
- ProFTPD will be automatically launched thanks to the /etc/init.d/S50proftpd script
- you can configure the server with: /etc/proftpd.conf