Tag Archive : ftp

/ ftp

Setup Slackware as Basic TFTP Server

December 11, 2015 | Article | No Comments

TFTP or Trivial File Transfer Protocol is a transfer protocol notable for its simplicity. TFTP is generally used for automated transfer of configuration or boot files between machines in a local environment, such as routers and PXE (Preboot eXecution Environment) mechanism. Compared to FTP, TFTP is extremely limited, providing no authentication and is rarely used interactively by a user.

There are many TFTP implementations, such as:

  • GNU inetutils
  • tftp-hpa
  • atftp
  • tftp-server
  • etc…

In this article, we will discuss about how to set Slackware as a basic  TFTP server. In specific, we will use tftp-hpa which is included by default. This article is tested using Slackware64 14.0 and tftp-hpa.

Upgrade or Not?

Slackware has shipped a TFTP server by default which is tftp-hpa. The version is 0.49. However we can install the latest tftp-hpa with simple process. If you decided to install the latest version, follow this section. Otherwise you can skip to next section.

Download the latest version of tftp-hpa here: www.kernel.org/pub/software/network/tftp/tftp-hpa/. The latest version is 5.2 which can be downloaded here: www.kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-5.2.tar.xz

Now invoke following series of command to build TFTP (server and client):

tar -Jxf tftp-hpa-5.2.tar.xz
cd tftp-hpa-5.2
./configure --prefix=/usr
make
cd tftp && strip --strip-unneeded tftp
cd ../tftpd && strip --strip-unneeded tftpd
cd ..

Now install it (make sure you are using root privileges):

make install

Set up

By default, the inetd use /tftpboot directory as root directory of the TFTP server. We can however change the directory to something else. Make sure the directory exists, whichever directory you use.

Suppose we want to use /usr/local/tftpboot as root directory:

mkdir -p /usr/local/tftpboot

Then we give a proper permission:

chmod +777 /usr/local/tftpboot
chown nobody /usr/local/tftpboot

Next we add the following entry to the /etc/inetd.conf file as a single line. Or you can edit it and make sure it’s uncommented.

tftp  dgram   udp     wait    root    /usr/sbin/in.tftpd  in.tftpd -s /usr/local/tftpboot -r blksize

Then, restart the inetd using root privileges.

/etc/rc.d/rc.inetd restart

Testing

Now, let’s testing our TFTP server. In our simple scenario, we will create a plain text and fill something there. Then we will download it via tftp.

echo "Xathrya was testing the TFTP server" >> /usr/local/tftpboot/test.txt

To download it, use:

tftp 127.0.0.1 -c get test.txt

And see in current directory, whether we have successfully download it:

cat test.txt

It should print out “Xathrya was testing the TFTP server”.

File Transfer Protocol (FTP) is a standard network protocol used for transferring files from one host to another host over a TCP-based network. The party involving two side: server and client, in other words it use client-server architecture. One famous FTP server is VSFTPD (Very Secure FTP Daemon).

In this article we will discuss about how to install VSFTPD to Arch Linux ARM, one of Linux distribution for ARM processor. Specifically, I use:

  1. Raspberry Pi model B, for machine
  2. Arch Linux ARM release 2013-07-22

Before we started, make sure you have installed Arch Linux ARM on your device.

Update the Repository

It is a good choice to update the repository as Arch Linux release new package periodically without save the old package. Arch Linux ARM use the very same package manager system like its parent uses. Therefore the command should be similar.

Make sure you have setup the Arch Linux ARM Repository.

To update the repository, do following:

pacman -Syy

Make sure your device can access the internet.

Installation

Installing vsftpd is really straightforward. We can install vsftpd from the Official Repositories by:

pacman -S vsftpd

Package manager will download the required package, depends on your connection. It will also install it automatically once the package are downloaded.

Start / Enable Server

We can enable server, which means the server started everytime we boot the device. Arch Linux use systemd, so to make it run automatically at boot time, do following:

systemctl enable vsftpd.service

While you can make it disabled / not run automatically by:

systemctl disable vsftpd.service

To start it manually, do:

systemctl start vsftpd.service

We can stop the service by:

systemctl stop vsftpd.service

List of FTP Commands

December 5, 2015 | Article | No Comments

This article is a summary of commands used by FTP protocol. The commands are alphabetically ordered.

# Command Description
1 ABOR aborting active transfer operation
2 ACCT get account information
3 ADAT data authentication
4 ALLO allocate some disk space for receiving file
5 APPE append file
6 AUTH authentication mechanism
7 CCC delete / remove Channel Command
8 CDUP change to parent directory
9 CONF Confidentiality Protection Command
10 CWD change current working directory
11 DELE delete a file
12 ENC Privacy Protected Channel
13 EPRT gives extended address and port that must be connected
14 EPSV entering extended passive mode
15 FEAT get list of feature implemented by server
16 HELP get list of command available (help)
17 LANG Language Negotiation
18 LIST get file or directory information. If no specified, then information of current directory will be given
19 LPRT give information of long address and port that must be connected
20 LPSV entering long passive mode
21 MDTM give information of last update time of a file
22 MIC Integrity Protected Command
23 MKD make directory
24 MLSD list directory
25 MLST providing data of specific object.
26 MODE transfer mode setting (stream, block, or compressed)
27 NLST return list of filename in specific directory
28 NOOP No Operation (dummy packet, used for maintain connection / session)
29 OPTS choose option for a feature
30 PASS password authentication
31 PASV use passive mode to communicate
32 PBSZ Protection Buffer Size
33 PORT gives specific information of port number which will be called
34 PROT Data Channel Protection Level
35 PWD print working directory / current directory
36 QUIT disconnect from server
37 REIN reinitialize connetion
38 REST send a copy of file
39 RMD remove directory
40 RNFR rename filename from
41 RNTO rename filename to
42 SITE give / send specific command to server
43 SIZE return file size information
44 SMNT mount file structure
45 STAT return current status
46 STOR receive data and store as file on server
47 STOU store file as unique file (no file having same name)
48 STRU setting the file transfer structure
49 SYST return information of sistem type
50 TYPE set transfer mode (ASCII or binary)
51 USER username authentication
52 XCUP change parent of current directory
53 XMKD make directory
54 XPWD display current directory
55 XRCP
56 XRMD remove directory
57 XRSQ
58 XSEM send data, if unsuccessful the operation will be swapped to mail
59 XSEN Send data to terminal

A

Social Share Buttons and Icons powered by Ultimatelysocial