Skip to content Skip to sidebar Skip to footer

Steps to Upload to Ftp Server Command Line

How to Upload Files with FTP


Last modified: August 24, 2021

Overview

This document explains how to use the command-line interface (CLI) or a third-party customer to store files on your File Transfer Protocol (FTP) server.

Connect to an FTP server with a 3rd-party customer

If you open another programme to connect to your FTP server, you are using a third-party FTP customer. Third-political party clients like Cyberduck and WinSCP have their own documentation, but will require the following data:

  • Server Protocol: FTP (File Transfer Protocol).
  • Server Proper noun: Either your principal domain name or your site'south IP address.
  • User/Username: Your business relationship name.

    Important:

    The username formatting must exactly match the information in the FTP Accounts interface (cPanel >> Home >> Files >> FTP Accounts) for the third-party client to piece of work. For case, if example.com is your primary domain name, your username will be formatted [email protected].

  • Password: Your FTP password.

    Note:

    The FTP server's port number defaults to 21, but is not always required.

Connect to an FTP server from the command line

To connect to the FTP sever from the CLI, follow these steps:

  1. Open a CLI window on your local machine.
  2. Enter the ftp control to open the File Transfer Protocol.
  3. Enter open to open a connection between your local machine and your FTP server. Your CLI window will await something similar this:
  4. In the (to) prompt, enter your server's IP address. Depending on which FTP daemon y'all are using, your CLI window volition now wait something like this:

                                          [[email protected] ~]: ftp ftp> open up                    (to)                    0.0.0.0                    220---------- Welcome to Pure-FTPd                    [privsep]                    [TLS]                    ----------                    220-You are user number                    1                    of                    50                    immune.                    220-Local fourth dimension is now                    15:34. Server port:                    21.                    220-This is a private system - No bearding login                    220-IPv6 connections are also welcome on this server.                    220                    You will be asunder after                    15                    minutes of inactivity. Name                    (                    0.0.0.0:example):                
  5. Enter your FTP account's username into the Name(0.0.0.0:instance) prompt.

  6. Enter your FTP account's countersign into the Countersign: prompt.

If you have entered the correct login information, the system will return a message like to the following:

                              230                OK. Current restricted directory is /.                          

Important:

If you have entered the incorrect login data, the system will return a message similar to the following:

                                      530                    Login hallmark failed                

Upload a file to an FTP server from the command line

To upload a file to your FTP server using the CLI, follow the documentation above to connect to an FTP server from the command line and then:

  • If you are not in the file's desired destination binder, navigate there using the cd command. For case, to move a file to a server's public_html binder then that it is visible to the site users, cd to public_html.
  • Use the put command to transfer the file from its current path. For case, to motion the finalized-doc.txt file from the local auto'due south unfinished-documents folder to your FTP server's public_html folder to go far visible to site users, enter:
                      ftp> cd public_html ftp> put localmachine:\unfinished-documents\finalized-md.txt                                  

    Important:

    Your site's root directory is set to the public_html folder. Uploading files into the / directory will non let site users view these files. Instead, to brand files visible to your site's users, you must put these files into the public_html folder.

Download a file from an FTP server from the command line

To download a file to your FTP server using the CLI, follow the documentation above to connect to an FTP server from the command line and and so:

  • If yous are not in the file'southward current location on the FTP server, navigate at that place using the cd command. For example, files that are visible to site users volition be stored in the public_html folder, so to download a file from there, cd to public_html.
  • Use the go command to transfer the file from its current path. For instance, to download the document-with-a-error.txt file from the FTP server's finalized-documents subfolder in the public_html folder, enter:
                      ftp> cd public_html/finalized-documents ftp> get document-with-a-fault.txt                                  

Additional Documentation


  • Anonymous FTP
  • FTP Accounts
  • FTP Connections
  • FTP Server Configuration
  • FTP Server Selection
  • The cPanel Glossary

cPanel, WebHost Manager and WHM are registered trademarks of cPanel, L.L.C. for providing its computer software that facilitates the management and configuration of cyberspace web servers.

skaggsding1997.blogspot.com

Source: https://docs.cpanel.net/knowledge-base/ftp/how-to-upload-files-with-ftp/

แสดงความคิดเห็น for "Steps to Upload to Ftp Server Command Line"