Solaris FTP Server Setup

The FTP on Solaris is not set up by default. To set it up, do the following:

1. Login as root

2. Create a new user “ftp” in /etc/passwd file as follows:

ftp:x:123:1:Anonymous FTP:/export/home/ftp:/bin/true

3. Then we need to sync this file with /etc/shadow with:

pwconv

4. Create a directory for this ftp account like this:

mkdir /export/home/ftp

Change the ownership on this directory to:

chown -R root:other /export/home/ftp

5. Set permissions on just created directory with 555 permission:

chmod 555 /export/home/ftp

6. Create directory pub where the files will be uploaded and downloaded from:

mkdir /export/home/ftp/pub

7. Change permissions on this pub directory to:

chmod 777 /export/home/ftp/pub

8. Modify /etc/ftpd/ftpaccess file by adding the following line:

upload /export/home/ftp /pub yes ftp other 0600 nodirs

9. Now start the ftp server. You will need to su, pfexec, or however you have Solaris setup to run this command

inetadm -e ftp

10. Test to see if the ftp server is running

inetadm | grep ftp

The FTP server should allow the connection and upload/download of files now by anonymous user

When anonymous user logs in, the login should be anonymous and the password is the email address. After logging in, the user should go to pub directory by invoking:

cd pub

Then the user can add a file from his current directory by doing:

put “filename” – where “filename” is the name of the file to be uploaded to the server

In order to get a file user should do:

get “filename”

@LongLink When Using Tar In Solaris

Problem

I was trying to install Archiva so that I can use it as a mirror repository for Maven and I ran into a problem when trying to extract the Archiva package which I had downloaded.

When I ran the following command

$tar -xvf apache-archiva-1.3.2-bin.tar
There were a whole bunch of the following errors:

x apache-archiva-1.3.2/apps/archiva/WEB-INF/classes/org/apache/maven/archiva/web/action/ShowArtifactAc, 6392 bytes, 13 tape blocks
tar: ././@LongLink: typeflag ‘L’ not recognized, converting to regular file

and after running the command, there was a file called @LongLink in the directory.

-rw-r–r– 1 username group 121 Nov 25 00:04 @LongLink

It turns out, Solaris tar cannot handle very long file names.

Solution

User GNU tar instead. On Solaris 10, /usr/sfw/bin/gtar is available as part of the SUNWgtar package.

$/usr/sfw/bin/gtar -xvf apache-archiva-1.3.2-bin.tar