Archive for the ‘FTP Tutorial’ category

How to use Chmod

September 29th, 2011

The chmod command is used in Linux-based systems to set permissions on a file or folder. This can be very important in making your website hosted with us function as it should when served to the public.

FTP Usage

If you’re not a Linux guru, this is generally the easiest way to change chmod settings. You can generally modify chmod settings in any FTP client by right clicking on a file or folder and choosing chmod. Generally multiple files or folders can be selected by using the shift or CTRL keys. This feature is also available in the web-based file manager located in your control panel.

CHMOD and File Permission Settings
400 r——– files (won’t let you accidently erase)
444 r–r–r– files (lets everyone read)
600 rw——- files (no one else can read or see files)
644 rw-r–r– files
664 rw-rw-r– files
666 rw-rw-rw- files (note: this could allow serious havoc)
700 rwx—— Programs and Directories
750 rwxr-x— Programs and Directories
755 rwxr-xr-x Programs and Directories
777 rwxrwxrwx Programs and Directories
Note: 777 will produce a wide open executable script, this is dangerous!

SSH Usage

This can also be done via SSH if you’re more familiar with this interface. The chmod command options are specified like this:

$ chmod [options] mode[,mode] file1 [file2 ...]

To view what the permissions currently are, type:

$ ls -l file 
Command line examples
chmod +r file    read is added for all
chmod -x file    execute permission is removed for all
chmod u=rw,go= file    read and write is set for the owner, all permissions are cleared for the group and others
chmod +rw file    change the permissions of the file file to read and write for all.
chmod -R u+w,go-w docs/    change the permissions of the directory docs and all its contents to add write access for the user, and deny write access for everybody else.
chmod file    removes all privileges for all
chmod 664 file    sets read and write access for the owner, the group, and not for all others.
chmod 0755 file    equivalent to u=rwx (4+2+1),go=rx (4+1 & 4+1). The 0 specifies no special modes.
chmod 4755 file    the 4 specifies set user ID and the rest is equivalent to u=rwx (4+2+1),go=rx (4+1 & 4+1).
find path/ -type d -exec chmod a-x {} \;    removes execute permission for all directories (cannot list files) in tree starting from path/ (use ‘-type f’ to match files only).
find path/ -type d -exec chmod a+x {} \;    allows directory browsing (ls for example) for all users if you’ve reset permissions for Samba write access.
chmod -R u+rwX,g-rwx,o-rwx directory    set a directory tree to rwx for owner directories, rw for owner files, — for group and others.
chmod -R a-x+X directory    remove the execute permission on all files in a directory tree, while allowing for directory browsing.

			

Creating a New FTP Site Using IIS 7 Manager

April 30th, 2011

The new FTP service makes it easy to create new FTP sites by providing you with a wizard that walks you through all of the required steps to create a new FTP site from scratch.

Step 1: Use the FTP Site Wizard to Create an FTP Site

In this first step you will create a new FTP site that anonymous users can open.

Note: The settings listed in this walkthrough specify “%SYSTEMDRIVE%\inetpub\ftproot” as the path to your FTP site. You are not required to use this path; however, if you change the location for your site you will have to change the site-related paths that are used throughout this walkthrough.

  1. Open IIS 7 Manager. In the Connections pane, click the Sites node in the tree.
  2. As shown in the image below, right-click the Sites node in the tree and click Add FTP Site, or click Add FTP Site in the Actions pane.
    • Create a folder at “%SystemDrive%\inetpub\ftproot”
    • Set the permissions to allow anonymous access:
      1. Open a command prompt.
      2. Type the following command:
        ICACLS "%SystemDrive%\inetpub\ftproot" /Grant IUSR:R /T
      3. Close the command prompt.

  3. When the Add FTP Site wizard appears:
    • Enter “My New FTP Site” in the FTP site name box, then navigate to the %SystemDrive%\inetpub\ftproot folder that you created in the Prerequisites section. Note that if you choose to type in the path to your content folder, you can use environment variables in your paths.
    • When you have completed these items, click Next.

  4. On the next page of the wizard:
    • Choose an IP address for your FTP site from the IP Address drop-down, or choose to accept the default selection of “All Unassigned.” Because you will be using the administrator account later in this walk-through, you must ensure that you restrict access to the server and enter the local loopback IP address for your computer by typing “127.0.0.1″ in the IP Address box. (Note: If you are using IPv6, you should also add the IPv6 localhost binding of “::1″.)
    • Enter the TCP/IP port for the FTP site in the Port box. For this walk-through, choose to accept the default port of 21.
    • For this walk- through, do not use a host name, so make sure that the Virtual Host box is blank.
    • Make sure that the Certificates drop-down is set to “Not Selected” and that the Allow SSL option is selected.
    • When you have completed these items, click Next.

  5. On the next page of the wizard:
    • Select Anonymous for the Authentication settings.
    • For the Authorization settings, choose “Anonymous users” from the Allow access to drop-down, and select Read for the Permissions option.
    • When you have completed these items, click Finish.

Summary

You have successfully created a new FTP site using the new FTP service. To recap the items that you completed in this step:

  1. You created a new FTP site named “My New FTP Site”, with the site’s content root at “%SystemDrive%\inetpub\ftproot”.
  2. You bound the FTP site to the local loopback address for your computer on port 21, and you chose not to use Secure Sockets Layer (SSL) for the FTP site.
  3. You created a default rule for the FTP site to allow anonymous users “Read” access to the files.

Step 2: Adding Additional FTP Security Settings

Creating a new FTP site that anonymous users can browse is useful for public download sites, but web authoring is equally important. In this step, you add additional authentication and authorization settings for the administrator account. To do so, follow these steps:

  1. In IIS 7 Manager, click the node for the FTP site that you created earlier, then double-click FTP Authentication to open the FTP authentication feature page.
  2. When the FTP Authentication page displays, highlight Basic Authentication and then click Enable in the Actions pane.
  3. In IIS 7 Manager, click the node for the FTP site to re-display the icons for all of the FTP features.
  4. You must add an authorization rule so that the administrator can log in. To do so, double-click the FTP Authorization Rules icon to open the FTP authorization rules feature page.
  5. When the FTP Authorization Rules page is displayed, click Add Allow Rule in the Actions pane.
  6. When the Add Allow Authorization Rule dialog box displays:
    • Select Specified users, then type “administrator” in the box.
    • For Permissions, select both Read and Write.
    • When you have completed these items, click OK.

Summary

To recap the items that you completed in this step:

  1. You added Basic authentication to the FTP site.
  2. You added an authorization rule that allows the administrator account both “Read” and “Write” permissions for the FTP site.

Step 3: Logging in to Your FTP Site

In Step 1, you created an FTP site that anonymous users can access, and in Step 2 you added additional security settings that allow an administrator to log in. In this step, you log in anonymously using your administrator account.

Note: In this step log in to your FTP site using the local administrator account. When creating the FTP site in Step 1 you bound the FTP site to the local loopback IP address. If you did not use the local loopback address, use SSL to protect your account settings. If you prefer to use a separate user account instead of the administrator account, set the correct permissions for that user account for the appropriate folders.

Logging in to your FTP site anonymously

  1. On your FTP server, open a command prompt session.
  2. Type the following command to connect to your FTP server:FTP localhost
  3. When prompted for a user name, enter “anonymous”.
  4. When prompted for a password, enter your email address.

You should now be logged in to your FTP site anonymously. Based on the authorization rule that you added in Step 1, you should only have Read access to the content folder.

Logging in to your FTP site using your administrator account

  1. On your FTP server, open a command prompt session.
  2. Type the following command to connect to your FTP server:FTP localhost
  3. When prompted for a user name, enter “administrator”.
  4. When prompted for a password, enter your administrator password.

You should now be logged in to your FTP site as the local administrator. Based on the authorization rule that you added in Step 2 you should have both Read and Write access to the content folder.

Summary

To recap the items that you completed in this step:

  1. You logged in to your FTP site anonymously.
  2. You logged in to your FTP site as the local administrator.

Using Filezilla FTP Tutorial

August 3rd, 2010

How to use FileZilla – An open source FTP client

This is a tutorial about FileZilla, an open source FTP client. I’m going to show you the basics about FileZilla.
FileZilla Client is a fast and reliable cross-platform FTP, FTPS and SFTP client with lots of useful features and an intuitive interface.

Things you will need to get started:

* A computer running Windows 2000, XP or Vista, although FileZilla also supports Mac and Linux.
* The FileZilla client which can be downloaded from the FileZilla Website http://filezilla.sourceforge.net/ .
* A cPanel account or any other FTP account which you will use to connect and upload your files/web through FileZilla.

Let’s get started now!

Step 1: Opening Filezilla

After you’ve downloaded the client, install it and open it up. Here is a screenshot of how FileZilla should look when opened.

File Zila Software

File Zila FTP Software

Now that you’ve successfully opened FileZilla, Let’s learn how to login to your FTP account.

Step 2: Click the ‘Site Manager’ button to open the site manager so you can create your site.

Filezila Site Manager

Filezila Site Manager

Step 3: The ‘Site Manager’ window will pop up.
Click the ‘New Site’ button. This is where you need to enter your web hosting account information.

FileZila Site Manager Setting

FileZila Site Manager Setting

I’ll explain to you what each field means:

* Host: The address of your site (yourdomain.com, or Ip Address)
* Port: The port of the FTP server (By default the port is 21, but some hosts change it)
* Servertype: THIS IS IMPORTANT, this is the type of connection the client will use, FTP is the normal connection you will want to use, there are other connections such as SFTP which is used to login into VPS’s and such, for now we will use FTP.
* Logontype: I’m not giving any details on this, for now let’s use Normal.
* User: your username
* Password: Your password

We will not use Account since it’s not required by this type of connection.

Step 4: Now that we’ve entered our info, let’s change the site’s name if you wish:
Click on New Site and down below press Rename and enter whatever you want.

FileZila Ftp Setting with Yourdomain

FileZila Ftp Setting with Yourdomain


Step 5: Click on the ‘Transfer Setting” button to Change Transfer Settings:

FileZila Transfer Setting

FileZila Transfer Setting

Click on the ‘Connect’ button to connect. If you are having problems connecting here are some things to check:

* It may be that you are behind a firewall and/or router and need to use passive FTP.  Enable passive FTP.
* It can’t hurt to check your ftp server address, username and password. User names and passwords are case sensitive.
Step 6: Once the FTP program makes a connection, your screen should look like this:

FileZila Ftp File Transfer

FileZila Ftp File Transfer

Connection established. You will see the folders of your site on the left side of the screen. They vary depending on the type of server you’re on (information provided in Login Details email from Version Next Technologies).

One of the folders you see is your website main directory, the rest of them are system folders, any modifications you make to the system folders may damage your website structure.

For PLESK server type your upload directory is httpdocs folder.

For cPanel server type your upload directory is public_html folder.

Step 7: Enter (double-click) your upload directory (public_html or httpdocs).

Step 8: Downloading and Uploading Files

How to upload a file from your computer to the FTP server:

* Locate the file you wish to upload in the 2nd image (Local site)
* Select the file by left clicking it.
* Hold down the left mouse button and drag the file over to the Remote Site (3rd Image) then release.

How to download a file to your computer:

* Locate the file you wish to download in the hosting site.
* Select the file by left clicking it.
* Hold down the left mouse button and drag the file over to the local site then release.

This basically covers all the basics of FileZilla.

Congratulations! You have just uploaded the website. It should be visible in your internet browser window.

NOTE: In order for the website to show only after you enter the domain name in internet browser your main webpage MUST be named index.html (or index.htm, index.php… you get the idea).
For more information on how to use FileZilla, please see FileZilla Documentation.

CHMOD – File Permissions Explained

September 17th, 2009

Setting file permissions is one of the most common tasks involved in uploading files to your hosting account, especially if you are using various scripts, eg. installing scripts the old fashioned way without Fantastico!

CHMOD refers to the command line option for setting file permissions first used on Unix systems and widely in use today.

For everyday users setting file permissions has been made even easier and you can set permissions for files and directors from both your cPanel File Manager, and also with an FTP client such as FileZilla.

CHMOD refers to the command for setting file permissions first used on Unix systems and commonly used today.

File permissions are divided into 3 categories

  • r if the read bit is set, - if it is not.
  • w if the write bit is set, - if it is not.
  • x if the execute bit is set, - if it is not.

These permissions are also applied across 3 groups – UGO which represents User, Group, Other.

Using the example permissions:

(rwx)  (r-x)  (r-x)
  |      |      |
 User  Group  Other

The first set of permissions (rwx) represents read, write, and execute permission for the User.
The second set (r-x) represents read and execute permissions the Group, and members belonging to the group.
The last set (r-x) represents read and execute permissions for Others, or the world/public at large!

Octal Notation:

A common way to represent these permission values and the values used in your cPanel File Manager and via the CHMOD option in your FTP client is in Octal notation.

You may have seen file permissions set to three digit values such as 755 above. Each permission setting can be represented by a numerical value:

  • The read “r” bit adds 4 to its total (in binary 100),
  • The write “w” bit adds 2 to its total (in binary 010), and
  • The execute “x” bit adds 1 to its total (in binary 001).

When these values are added together, the total is used to set specific permissions.

For example, a file index.php, with the following permissions rwx-r-x-r-x

(rwx)  (r-x)  (r-x)
  |      |      |
4+2+1  4+0+1  4+0+1

When converted to Octal notation, this gives you the permission setting of 755

Beware 666 and 777

Biblical implications aside, setting permissions to 666 or 777 will allow everyone to read and write to a file or directory. Such settings as these could allow tampering with sensitive files so in general, it’s not a good idea to allow these settings.

Setting files and directories to 777 will commonly result in HTTP 500 Errors.

Here are a list of some common settings, numerical values and their meanings:

  • -rw------- = (600) Only the user has read and write permissions.
  • -rw-r--r-- = (644) Only user has read and write permissions; the group and others can read only.
  • -rwx------ = (700) Only the user has read, write and execute permissions.
  • -rwxr-xr-x = (755) The user has read, write and execute permissions; the group and others can only read and execute.
  • -rwx--x--x = (711) The user has read, write and execute permissions; the group and others can only execute.
  • -rw-rw-rw- = (666) Everyone can read and write to the file. Bad idea.
  • -rwxrwxrwx = (777) Everyone can read, write and execute. Another bad idea.

Here are a couple of common settings for directories (note the d at the beginning for directory/folder permissions):

  • drwx------ = (700) Only the user can read, write in this directory.
  • drwxr-xr-x = (755) Everyone can read the directory, but its contents can only be changed by the user.

Uploading your website via FTP

September 17th, 2009

To access your account, use the details provided in your web hosting welcome email. If your domain name is not officially pointing to our servers yet, use the IP address and the Username which was sent to you in your welcome email. If you have additional questions regarding the ins and outs of FTP, please see our FTP support section, which covers it in broad detail.

Example:
ftp host: yourdomain.com.au or the temporary IP address which was sent to you.
ftp username: your cpanel username
ftp password: your cpanel password

The public_html is where your web page files and folders have to be placed !!!!

This is the directory, where files you want accessed from the web must be placed. Open the folder “public_html” , which is your “web accessible directory.” Upload the files you want accessible to your visitors and feel free to make the appropriate sub-directories you’ll require.

Preventing IP Bans While Uploading Files Via FTP

September 17th, 2009

Uploading or downloading an entire website, or a large number of files simultaneously, can use a lot of a server’s system/network resources. Version-next’s servers, like most web servers, are all set to limit the amount of simultaneous connections to prevent system overloads and any adverse affects on other clients while files are being transferred.

Preventing IP Bans While Uploading/Downloading Files Via FTP

Uploading or downloading an entire website, or a large number of files simultaneously, can use a lot of a server’s system/network resources. Version-next’s servers, like most web servers, are all set to limit the amount of simultaneous connections to prevent system overloads and any adverse affects on other clients while files are being transferred.

If the FTP client you are using to perform your transfers exceeds this limit, our servers are set to automatically ban your IP address temporarily, resulting in the loss of connection between your computer and the server. This will mean you will no longer have access to your emails or website while the block is in place or while you are connecting using the same IP address.

Whilst this block is only temporary and will be removed 30-60 minutes after the block was initiated, there are ways you can prevent this block from occurring in the first place.

Below are some suggestions which may help you in avoiding this problem:

1. Choose the right FTP client

The FTP client you use will have a big impact on how easy it is for you to transfer your website files. We think the programs listed here are all pretty good and worth a look:

http://filezilla.sourceforge.net/

http://www.wsftp.com/

http://www.bpftp.com/

http://www.coffeecup.com/

2. Configure Your FTP Client Correctly

The FTP clients above will all let you configure a wide range of settings affecting the transfer process. Probably the most important of these is the amount of connections your client will attempt to make to upload/download your files.

The example below shows you images of the FileZilla configuration settings. In this example we have used a “safe” setting of “max simultaneous connections : 4” and “max concurrent downloads/uploads : 8”.

3. Make Sure You Have the Correct Login Details Before You Begin.

The server blocks an offending client IP address after a certain number of failed login attempts. If you try to login a couple of times and it doesn’t work, clarify your details are correct and contact us if you require the details to be resent to the account holder’s email.

4. Be wary of FTP clients that are built into web design software

Many programs used to develop web pages include an FTP client, however these are generally better suited to being used for individual file uploads and “on the fly” page edits. They can lack “real” advanced configuration settings and often exceed server connection limits.

An example of this is Adobe (aka Macromedia) Dreamweaver. While being our preferred HTML editor, it unfortunately falls short on the FTP side and is often the source of client’s IP bans while transferring large quantities of files.

PHP Freelancer