You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



How To Add Files To ftp.mozilla.org

To get a file added to ftp.mozilla.org contact ftp-stage@mozilla.org to get someone to add your file for you. If you're a regular contributor, you can ask to get access to add the files yourself. This document describes how to get an account, the rules for using it, and some instructions on getting started.

You don't put files on the ftp server directly. Instead, you'll get a unix shell account on a staging server named stage.mozilla.org. You'll place your files on the staging server and they are automatically copied over to the main ftp server periodically. Log in to the staging server using ssh and copy files to the machine using either scp or sftp (secure ftp). After a time, nightly builds (and possibly other files) are deleted due to space constraints.

Terms Of Service

To get an account you'll need to sign our contributor form and agree to our terms.
  • Only use your account on stage.mozilla.org for maintaining the ftp site. Don't use the account to send or receive email. Don't use the machine to store files. If we're running low on disk space, stuff in your home directory may get deleted.
  • Don't upload stuff copyrighted by other people without their permission.
  • On Windows, be sure to run a virus scanner. Files uploaded to the staging server are checked nightly for viruses. If a virus is found on a file you uploaded it will be removed and your account will be disabled until you are sure your machine is virus-free.

What You'll Need

To get started you'll need an installation of ssh including scp or sftp. Our server runs OpenSSH 2.x and can handle ssh 1 or ssh 2 clients. If you don't already have it, get a free copy of the ssh client from openssh.com or use some other ssh implementation. Most of the directions here are for openssh so if you use something else the commands may vary.

On Windows, its easiest to use OpenSSH from the Cygwin package. You probably already have this since Cygwin is required to build Mozilla. You can get Cygwin from cygwin.com. On mac, try MacSSH NiftyTelnet NiftyTelnet 1.1 SSH. For documentation on SSH, the OpenSSH group recommends the O'Reilly snail book.

It helps a lot to have an understanding of basic unix commands in order to copy, rename and move files around although I'll try and document the important commands here. If you're more comfortable with with using ftp, try getting an implementation of ssh2 which contains sftp. This is contained in the latest version of openssh. I'm not aware of any mac clients that have sftp. On windows, only daily snapshot builds of cygwin since March 1 contain it although you can probably find non-free clients with sftp. On Linux, be sure not to confuse 'secure ftp' with 'simple ftp' which is also known as 'sftp'.

How To Get An Account

  • contribute stuff so consistantly that people on the stage@mozilla.org alias get sick of adding your files.
  • Fill out a contributor form, fax it, mail it.
  • Open a bug requesting an account and note in it that you have faxed your form.
  • Create an ssh key if you don't have one already and attach your public key to the bug. With OpenSSH, if you're using an ssh2 client type ssh-keygen -d . If that didn't work, then just type ssh-keygen.

    With MacSSH:

    • Go to Favorites > Edit Favorites...
    • Pick your host
    • Click on Change
    • In the SSH2 tab, click on Initialize SSH This creates "identity" and "identity.pub" in the same directory with your MacSSH application
    • identity is your private key and identity.pub is the public key.
    • If you need to upload one, click the "Export public key" format to get it in the format most of the ssh servers want in your home directory.

How It Works

  • The staging area is in /home/ftp/pub of stage.mozilla.org.
  • The ftp server syncs with the staging area every 10 minutes. These updates only add or replace files.
  • File deletions only occur once per day at 2:30am PST. If you accidently delete files, you should be able retrieve the file from the main ftp site.
  • Since updates happen so often you may want to upload files to your home directory and then move the files to the staging area once everything has uploaded. If you don't, its possible that your partially uploaded file could be copied to the ftp server.
  • When creating directories in the mozilla nightly or releases directories, be sure group ownership is set to 'mozilla' and that the directory is group writable so others can add files that directory as well.
  • When adding a milestone build to a directory in mozilla/releases, add your name as a contributor to the bottom the the README file.

Getting Started

These basic commands will get you started:
umask 002
ssh -l <yourloginid> stage.mozilla.org <unix-command>
scp -p <localfile> <yourloginid>@stage.mozilla.org:/home/ftp/pub/<path>
  • Set the umask on your local machine so the file will be readable by others when you copy them to the staging server.
    umask 002
    
  • Copy a file to the latest directory.
    scp mozilla-win32.exe \
      beauzeau@stage.mozilla.org:/home/ftp/pub/mozilla/latest
    
  • Create a new directory.
    ssh -l beauzeau stage.mozilla.org \
      mkdir /pub/mozilla/nightly/2001-03-18-22-Mtrunk
    
  • Copy a directory and its contents to the staging area. Preserve the mode and time stamps of original files.
    scp -rp 2001-04-01-09 beauzeau@stage.mozilla.org:/home/ftp/pub/mozilla/nightly
    
  • Execute a command on the staging server which fixes directory permissions so others can add files to the directory as well.
    ssh -l beauzeau stage.mozilla.org chmod 775 \
      /home/ftp/pub/mozilla/nightly/2001-04-01-09 \; \
      chgrp mozilla /home/ftp/pub/mozilla/nightly/2001-04-01-09
    
    You may need to pass the -R option to the chmod and chgrp commands so that they also fix the permissions on all the files and subdirectories in the directory. Use the ls -l command to verify the group and permissions are correct.
    ssh -l beauzeau stage.mozilla.org ls -l \
      /home/ftp/pub/mozilla/nightly/2001-04-01-09
    

Scripting

If you use a script to generate files or data, you've problably noticed that you can add ssh and scp commands to your script but that when those commands are executed the script stops, waiting for you to type in your passphrase. Not very automated, is it? To work around this problem, use the utility ssh-agent to store your keys. With this daemon running in the background, subsequent invocations of ssh and scp won't require you to type in the password. Following, are some example scripts and an explanation of what they do.

  1. Start ssh-agent. Redirect the output to a file for later use by scripts. Set permissions on the file so others may not access it. The output of ssh-agent is commands to set the SSH_AUTH_SOCK and SSH_AGENT_PID environment variables. When these are set, in your shell or in your script, subsequent invocations of ssh-add, ssh and scp will use that ssh-agent for handling credentials and you won't have to keep retyping your passphrase.
  2. Set the environment variables output by ssh-agent when you started it. Run ssh-add and type your passphrase when it prompts you.
  3. In your script, set the ssh-agent variables you set in step one. Now, when you use ssh or scp you shouldn't need to type a passphrase.
  4. When you're done, be sure to kill your ssh-agent with ssh-agent -k.
------- script to start ssh-agent and enter password -------------
#!/bin/sh

ssh-agent -s > ~/.ssh/agentvars  # use -s for use in bourne shell scripts
#ssh-agent -c > ~/.ssh/agentvars # use -c for use in C shell scripts
chmod 700 ~/.ssh
chmod 600 ~/.ssh/agentvars
source ~/.ssh/agentvars
ssh-add
------------------------------------------------------------------
-------- example script that uses scp without password -----------
#!/bin/sh

user=beauzeau
source ~/.ssh/agentvars
# add the above two lines to your own script. replace
# 'beauzeau' with your own user account on stage.mozilla.org

date > blah.date
umask 002
scp blah.date $user@stage.mozilla.org:/home/$user
echo done!
ssh-agent -k
echo agent killed!
------------------------------------------------------------------

Troubleshooting

  • Our ssh server runs OpenSSH 2.x. To connect to it with an OpenSSH 2.x client, you'll need to use a DSA key. The keygen command creates an RSA key by default. You need to run ssh-keygen -d to create a DSA key.
  • If you use SSH Secure Shell for Win32 from SSH Communications Security (www.ssh.com) you'll need to convert your private key over to the openssh format before adding it to your authorized keys file using
    ssh-keygen -X -f authorized_keys2.orig > authorized_keys2
    
  • The machine you connect from must have both forward and reverse DNS entries and your network's DNS server must be operating or your connection will be refused.

Many thanks to Source Forge, for hosting our staging server, stage.mozilla.org.

Contact: FTP Admin <ftp-stage@mozilla.org>