Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
44.  Accessing Remote Systems (Tasks) Logging In to a Remote System (rlogin) How to Log In to a Remote System (rlogin)  Previous   Contents   Next 
   
 

Example--Logging In to a Remote System (rlogin)

The following example shows the output of a direct remote login to pluto. The user has been authenticated by the network.

$ rlogin starbug
Last login: Mon Jul 12 09:28:39 from venus
Sun Microsystems Inc.   SunOS 5.8       February 2000
starbug:

The following example shows the output of an indirect remote login to pluto, with the user being authenticated by the remote system.

$ rlogin -l smith pluto
password: user-password
Last login: Mon Jul 12 11:51:58 from venus
Sun Microsystems Inc.   SunOS 5.8       February 2000
starbug: 

How to Log Out From a Remote System (exit)

Log out from a remote system by using the exit(1) command.

$ exit
 

Example--Logging Out From a Remote System (exit)

This example shows the user smith logging out from the system pluto.

$ exit
pluto% logout
Connection closed.
earth% 

Logging In to a Remote System (ftp)

The ftp command opens the user interface to the Internet's File Transfer Protocol. This user interface, called the command interpreter, enables you to log in to a remote system and perform a variety of operations with its file system. The principal operations are summarized in the following table.

The main benefit of ftp over rlogin and rcp is that ftp does not require the remote system to be running UNIX. The remote system does, however, need to be configured for TCP/IP communications. However, rlogin provides access to a richer set of file manipulation commands than ftp provides.

Authentication for Remote Logins (ftp)

Authentication for ftp remote login operations can be established by one of the following methods:

  • Including your password entry in the remote system's /etc/passwd file or equivalent network information service map or table

  • Establishing an anonymous ftp account on the remote system

Essential ftp Commands

Table 44-3 Essential ftp Commands

Command

Description

ftp

Accesses the ftp command interpreter.

ftp remote-system

Establishes an ftp connection to a remote system. For instructions, see "How to Open an ftp Connection to a Remote System".

open

Logs in to the remote system from the command interpreter.

close

Logs out of the remote system and returns to the command interpreter.

bye

Quits the ftp command interpreter.

help

Lists all ftp commands or, if a command name is supplied, briefly describes what the command does.

reset

Re-synchronizes the command-reply sequencing with the remote ftp server.

ls

Lists the contents of the remote working directory.

pwd

Displays the name of the remote working directory.

cd

Changes the remote working directory.

lcd

Changes the local working directory.

mkdir

Creates a directory on the remote system.

rmdir

Deletes a directory on the remote system.

get, mget

Copies a file (or multiple files) from the remote working directory to the local working directory.

put, mput

Copies a file (or multiple files) from the local working directory to the remote working directory.

delete, mdelete

Deletes a file (or multiple files) from the remote working directory.

For more information, see ftp(1).

How to Open an ftp Connection to a Remote System

  1. Ensure that you have ftp authentication.

    You must have ftp authentication, as described in "Authentication for Remote Logins (ftp)".

  2. Open a connection to a remote system by using the ftp command.

    $ ftp remote-system

    If the connection succeeds, a confirmation message and prompt are displayed.

  3. Type your user name.

    Name (remote-system:user-name): user-name
  4. If prompted, type your password.

    331 Password required for user-name:
    Password: password

    If the system you are accessing has an established anonymous ftp account, you are prompted for an email address for the password. If the ftp interface accepts your password, it displays a confirmation message and the (ftp>) prompt.

    You can now use any of the commands that are supplied by the ftp interface, including help. The principal commands are summarized in Table 44-3.

Example--Opening an ftp Connection to a Remote System

This ftp session was established by the user smith on the remote system pluto:

$ ftp pluto
Connected to pluto.
220 pluto FTP server ready.
Name (pluto:smith): smith
331 Password required for smith:
Password: password
230 User smith logged in.
ftp>

How to Close an ftp Connection to a Remote System

Close an ftp connection to a remote system by using the bye command.

ftp> bye
221-You have  transferred 0 bytes in 0 files.
221-Total traffic for this sessions was 172 bytes in 0 transfers.
221-Thanks you for using the FTP service on spdev.
221 Goodbye.

A goodbye message appears, followed by your usual shell prompt.

How to Copy Files From a Remote System (ftp)

  1. Change to a directory on the local system where you want the files from the remote system to be copied.

    $ cd target-directory
  2. Establish an ftp connection.

    See "How to Open an ftp Connection to a Remote System".

  3. Change to the source directory.

    ftp> cd source-directory

    If your system is using the automounter, the home directory of the remote system's user appears parallel to yours, under /home.

  4. Ensure that you have read permission for the source files.

    ftp> ls -l
  5. Set the transfer type to binary.

    ftp> binary
  6. To copy a single file, use the get command.

    ftp> get filename 
  7. To copy multiple files at once, use the mget command.

    ftp> mget filename [filename ...]

    You can supply a series of individual file names and you can use wildcard characters. The mget command copies each file individually, asking you for confirmation each time.

  8. Close the ftp connections.

    ftp> bye
 
 
 
  Previous   Contents   Next