Yafc ftp client
Data Shovel
![© drx, Fotolia © drx, Fotolia](/var/linux_magazin/storage/images/linux-magazine.com/issues/2008/94/data-shovel/fo_7763272_lkw_drx.png/429620-1-eng-US/fo_7763272_LKW_drx.png_medium.png)
© drx, Fotolia
The console-based yafc client gives users a convenient, simple, and interactive approach to exchanging data with ftp and SSH servers.
Although most Linux distributions typically include an ftp program, it is likely to be less than intuitive. And the same thing can be said about the web-based ftp solutions offered by various providers.
Modern desktops like Gnome or KDE include ftp extensions that support drag and drop, but they are of little use if you need to set the permissions for the files on the server, and they do not lend themselves to scripting. The yafc ftp client [1] (Yet Another Ftp Client) might be slightly older – and console based, like ftp – but it also offers more options and is more convenient to use (Figure 1).
On Ubuntu, you can sudo apt-get install yafc to install the tool on your hard disk. SUSE has version 1.1.1 as a binary package, and you can run the package manager to install it. If the distribution of your choice does not include yafc, you will find the source code for a build-it-yourself version on the project website.
Before you can use ftp and yafc to transfer data, you need access to the ftp server at the other end. On top of this, you need credentials – a username and a password. To open a connection to the server in a terminal window, type a command with the following syntax:
$ yafc Options Protocol://User:Password@Server:Port/Directory
The most useful options here include -a for anonymous access (which the server needs to support) or -q to suppress the welcome text. Typing yafc -h displays a full list of options.
If you do not specify the protocol, yafc will default to ftp://. Alternatively, the client also supports encrypted ssh:// communications (see Figure 2).
The server at the other end will need to be an SSH server rather than an ftp server in this case. In contrast to ftp, the advantage is that cleartext passwords are not sent.
Besides the protocol, you can also omit the username. Yafc will then supply your local username. The -u option suppresses this default behavior, and then yafc will prompt you to enter a username. In addition to the username, you can type a password for your account on the server with a colon as the separating character. For security reasons, this is only recommended for automated scripts – or situations in which you are sure that nobody is shoulder surfing.
Although you must type the server name, the port is not required unless the server at the other end uses a non-standard port. If needed, you can specify the directory on the server in which you want yafc to start working.
The command
$ yafc ssh://hopfnehn@172.17.0.221:/documents
opens an SSH-encrypted connection to the server at 172.17.0.221 for the user hopfnehn. Then the server prompts the user for the password and grants the ftp client to the /documents directory.
Yafc can handle multiple, parallel connections to servers. The command
$ yafc ssh://hopfnehn@172.17.0.221:/documents ssh://hoepfner@172.17.0.222
tells yafc to open another connection parallel to the existing one. To toggle between the two connections, you can type the switch command in interactive mode.
Instead of opening a connection to a server when you launch yafc, you can launch the client in interactive mode. The command
yafc> open ssh://hopfnehn@172.17.0.221:/documents ssh://hoepfner@172.17.0.222
at the yafc command-line prompt opens connections to the required servers.
Interactive Mode
After opening a connection, yafc switches to interactive mode, from which you can type commands to transfer files. Several commands are available for this, and they also support navigating the server and client directories.
Just like the familiar shell command, ls lists the current server directory, cd directory changes to another directory, and pwd tells you your current working directory (Figure 3). To run these commands locally instead of on the server, just type an exclamation mark before the command. To get a list of commands, enter help.
![](/var/linux_magazin/storage/images/linux-magazine.com/issues/2008/94/data-shovel/figure-3/429629-1-eng-US/Figure-3_large.png)
The put command transfers a file from the client to the server, and get retrieves a file from the server and stores it on the client. Yafc might prompt you before overwriting existing files or directories. One big advantage over other console-based ftp programs is yafc's ability to recursively transfer directories. The put -r test/ command not only copies the test directory to the server, but also all the files and subdirectories below it. If needed, recursion in combination with get helps users create complete backup copies of their server data.
After exchanging data, you can close your connection(s) with the close command and quit yafc by typing exit.
Conclusions
Console-based ftp clients are the tool of choice for manual or scripted file transfers for large numbers of files. Yafc, as one of the most convenient representatives of this species, has far more in the line of functionality to offer than the standard ftp client. Besides the options I looked at here, it also supports proxies or NOHUP data transmissions, during which transmission continues despite the user logging off – as long as the computer is running.
Infos
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.