FTP&Telnet
FTP&Telnet
AIM: Study of Telnet and FTP THE TELNET PROTOCOL Telnet is a protocol, which is part of the TCP/IP suite. It is quite similar to the UNIX rlogin program. Telnet allows you to control a remote computer from your own one. It is terminal emulation software. In the old days hard drives were homogeneous and expensive and there were no personal computers. To make use of existing computers you had to lease hard drive space and use terminals to operate the system. For developers this was great because computing became lots cheaper. You needed a server and many connections could be made. With telnet you can emulate this type of distributed computing and for example operate a supercomputer from a distance. TCP/IP works with ports and telnet has one also. Its nr 23. Its has several rfcs. Nr 854 dates back to 1983 and is named telnet protocol specification. With telnet you can do various things like send mail, log in to irc or proxy and even (though hardly anymore) view and modify websites. There are telnet services available allowing you to search through large databases using telnet. With this you use the remote computers power so it wont pressure your precious resources. Usually help or remote help are the commands to use to find out what you can and cannot do. If you cant see what you type in then set echo. Once you made a connection you can use the computer as if it was your own. You use command lines for this. Telnet knows different emulation types. VT-100 is mostly used. This emulation was used on the video terminals of DEC. There are still VT-100 servers running out there. Scientists use these. The Telnet protocol is often thought of as simply providing a facility for remote logins to computer via the Internet. This was original purpose although it can be used for many other purposes. It is best understood in the context of a user with a simple terminal using the local telnet program (known as the client program) to run a login session on a remote computer where his communication needs are handled by a telnet server program. It should be emphasized that the telnet server can pass on the data it has received from the client to many other types of process including a remote login server. It is described in RFC 854 and was first published in 1983. WHAT IS TELNET? Telnet programs are a type of terminal emulation program, just like modembased communication programs. The difference is that they allow you to access other computers through the Internet, rather than by dialing the other computers directly.
Telnet programs talk to other Internet-connected computers using whats called the Telnet protocol for communication. This protocol specifies how telnet programs should send data back and forth, allowing for interactive text sessions. The following is an example of an interactive session, with the remote computer displaying text, then waiting for the user to type some text: Connecting to xyzzy.com. Please enter your login: jsmith Password? ***** Welcome, jsmith. You have 3 new messages. Read them now (y/n)? y If you have accessed BBSs by modem before, using a communications program, then you will find telnet is similar. But it allows you to access Internet-connected BBSs and other systems worldwide. In addition to being a type of program and a protocol, telnet can also be used as a verb. To telnet to a system means to connect to a system with a telnet program. TELNET CLIENT OVERVIEW Windows 2000 Telnet Client uses the Telnet Protocol, part of the TCP/IP suite of protocols, to connect to a remote computer over a network. The Telnet client software allows a computer to connect to a remote server. You can use the Telnet client provided with Windows 2000 to connect to a remote computer, log on to the remote computer, and interact with it as if you were sitting in front of it. Users of previous versions of Windows Telnet Client may notice a few changes in the version included with Windows 2000. The most obvious change is that Telnet Client is now a command-line application rather than a Windows application. As a command-line application, Telnet Client will seem very familiar to users of UNIX-based Telnet clients. A major new feature found in Windows 2000 Telnet Client is NTLM authentication support. Using this feature, a Windows 2000 Telnet Client can log on to a Windows 2000 Telnet server using NTLM authentication. Notes For more information about using NTLM authentication with Windows 2000, see Windows 2000 Server Help. Telnet session logging is not supported in Windows 2000 Telnet Client.
USING TELNET Telnet provides user support for the Telnet protocol, a remote access protocol you can use to log on to a remote computer , network device, or private TCP/IP network. Open Notes Telnet
To open Telnet, click Start, click Run, and then type Telnet. You can also type
Telnet at the command prompt. Using Telnet, you can make a remote connection.
To use Telnet, you must have a TCP/IP protocol installed and configured on your
computer and you must have a user account established on a remote host. To display help for Telnet, type help at the command prompt. To start Telnet from a command prompt
To
open a command prompt, click Start, point to Programs, point to Accessories, and then click Command Prompt. The port number is optional unless a port number other than the Telnet default is required. The hostname argument is optional. If no host name is provided, Telnet does not automatically connect to a server when you start it.
Telnet commands: The Telnet Client command prompt accepts following commands. CommandDescription open close display Use open hostname portnumber to establish a Telnet connection to a host. Use the close command to close an existing Telnet connection. Use the display command to view the current settings for the Telnet client. The display command lists the current operating parameters. If you are in a Telnet session (connected to a Telnet server), to modify the parameters, press CTRL+]. This escapes from the Telnet session. (To return to the Telnet session, press ENTER.) The following operating parameters are available: WILL AUTH (NTLM Authentication) WONT AUTH WILL TERM TYPE WONT TERM TYPE LOCALECHO off LOCALECHO on Use the quit command to exit from Telnet. Use the set command to set the terminal type for the connection, turn on local echo, set authentication to NTLM, set the escape character, and set up logging. SET NTLM turns on NTLM. While you are using NTLM Authentication, you are not prompted for a logon name and password when connecting from a remote computer. SET LOCALECHO turns on local echoing. SET TERM {ANSI|VT100|VT52|VTNT} sets the terminal type to the appropriate terminal type. Use the VT100 terminal type if you are running normal command-line applications. Use the VTNT terminal type if you are running advanced command-line applications, such as edit. ESCAPE Character sets the key sequence to use for switching from session to command mode. For example, to set CTRL+P as your escape character, type set escape, press CTRL+P, and then press ENTER. LOGFILE FileName sets the file to be used for logging Telnet activity. The log file must be on your local computer. Logging begins automatically when you set this option. LOGGING turns on logging. If no log file is set, an error message is displayed. Use unset to turn off local echo or to set authentication to logon/password prompt. UNSET NLM turns off NLM. UNSET LOCALECHO turns off local echoing.
quit set
unset
CommandDescription status Use the status command to determine whether the Telnet client is connected. CTRL+] Press CTRL+] to move to the Telnet command prompt from a connected session. enter Use the enter command from the command prompt to go to the connected session (if it exists). ?/help Prints Help information. FTP Transfers files to and from a computer running A File Transfer Protocol (FTP) server service such as Internet Information Services. FTP can be used interactively or in batch mode by processing ASCII text files. Syntax ftp [-v] [-d] [-I] [-n] [-g] [-s: FileName] [-a] [-w:WindowSize] [-A] [Host] Parameters -v -d -i -n -g Suppresses the display of FTP server responses. Enables debugging, displaying all commands passed between the FTP client and FTP server. Disables interactive prompting during multiple file transfers. Suppresses the ability to log on automatically when the initial connection is made. Disables file name globing. Glob permits the use of the asterisk(*) and question mark (?) as wildcard characters in local file and path names. For more information, see Ftp:Glob. FileName Specifies a text file that contains ftp commands. These commands run automatically after ftp starts. This parameter allows no spaces. Use this parameter instead of redirection (<). Specifies that any local interface can be used when binding the FTP data connection. WindowSize Specifies the size of the transfer buffer. The default window size is 4096 bytes.
-s:
-a -w:
-A
Host Specifies the computer name, IP address, or Ipv6 address of the FTP server to which to connect. The host name or address, if specified, must be the last parameter on the line. /? Displays help at the command prompt.
Remarks You must prefix ftp parameters with a hyphen (-) rather than a slash (/). Ftp command-line parameters are case sensitive.
installed as a component in the properties of a network adapter in Network Connections. FTP can be used interactively. After it is started, ftp creates a subenvironment in which you can use ftp commands. You can return to the command prompt by typing the quit command. When the ftp subenvironment is running, it is indicated by the ftp > command prompt. For more information about ftp subcommands, see related topics. Ftp supports the use of IPv6 when the IPv6 protocol is installed. For more information, see IP version 6 and Ipv6 applications.
Examples
To
log on to the FTP server named ftp.example.microsoft.com, type the following command: ftp ftp.example.microsoft.com
To log on to the FTP server named ftp.example.microsoft.com and run the ftp
commands contained in a file named Resynch.txt, type the following command ftp s : resynch.txt ftp.example.microsoft.com Formatting Legend
Meaning Information that the user must supply Elements that the user must type exactly as shown Parameter that can be repeated several times in a command line Optional items
Between braces ({}) ; choices Set of choices from which the user Separated by pipe ( ). must choose only one Example: {even odd} Courier font Code or program output
Ftp subcommands: For more information, click a command: Ftp: ! Ftp: ? Ftp: append Ftp: ascii Ftp: bell Ftp: binary Ftp: Bye Ftp: cd Ftp: close Ftp: debug Ftp: delete Ftp: dir Ftp: disconnect Ftp: get Ftp: glob Ftp: hash Ftp: help
Ftp: lcd Ftp: literal Ftp: Is Ftp: mdelete Ftp: mdir Ftp: mget Ftp: mkdir Ftp: mls Ftp: mput Ftp: open Ftp: prompt Ftp: put Ftp: pwd Ftp: quit Ftp: quote Ftp: recv Ftp: remotehelp Ftp: rename Ftp: rmdir Ftp: send Ftp: status Ftp: trace Ftp: type Ftp: user Ftp: verbose FILE TRANSFER PROTOCOL AND REMOTE LOGIN File Transfer protocol, the protocol used on the Internet for exchanging files. FTP works in the same way as HTTP for transferring Web pages from a server to a users browser and SMTP for transferring electronic mail across the Internet in that, like these technologies, FTP uses the Internets TCP/IP protocols to enable data transfer. FTP is most commonly used to download a file from a server using the Internet or to upload a file to a server (e.g., uploading a Web page file to a server). FTP client software allows you to transfer files between your hard drive and a remote server. For instance, you could put your personal page up on the Web by transferring files from your hard drive to a Web server, or you can download programs from your favorite shareware site. The difference between FTP and HTTP
Although HTTP do a good job of downloading HTML files and the small bitmaps displayed within them, it was never designed to transfer large files. However, with FTP, you can download large files and resume transfer after interruptions, where you leftoff, saving time (read that money) and aggravation (priceless). FTP uses find transferring files via e-mail attachments grossly inefficient or impractical when dealing with large documents. For uploading such files, FTP is the only standard answer (e.g., for efficiently posting new HTML pages onto a Web site or sharing graphics-laden files). Today, growing number of power users, telecommuters, and corporate Internet managers are unleashing the protocols potential by using FTP clients file transfer software applications designed for users to minimize time spent online. FTP is a general protocol that works on UNIX systems as well as a variety of other (non UNIX) systems. For the purposes of this Web page, the local machine refers to the machine you are initially logged into, the one on which you type the ftp command. The remote machine is the other one, the one that is the argument of the ftp command. A user interface for the standard File Transfer Protocol for ARPANET, FTP acts as an interpreter on the remote machine. The user may type a number of UNIX- like commands under this interpreter to perform desired actions on the remote machine. Most operating systems and communication programs now include some form of an FTP utility program, but the commands differ slightly between them. The following explanations and alphabetical list of commands refers to the common FTP utility program as provided on a UNIX machine. Getting Started To connect your local machine to the remote machine, type ftp machine name where machine name is the full machine name of the remote machine, e.g., purecell.cs.colostate.edu. If the name of the machine is unknown, you may type ftp machinennumber where machinennumber is the net address of the remote machine, e.g., 129.82.45.181. In either case, this command is similar to logging on to the remote machine. If the remote machine has been reached successfully, FTP responds by asking for a loginname and password. When you enter your own loginname and password for the remote machine, it returns the prompt ftp > and permits you access to your own home directory on the remote machine. You should be able to move around in your own directory and to copy files to
and from your local machine using the FTP interface commands given on the following page. ABSTRACT While there are a variety of ftp commands, the following is a selected list of the most common commands. Note that these commands are not relevant to graphical FTP programs such as FETCH or WS_FTP. I. Opening and closing connection
ftp starts an FTP session open hostname connects to the specified host close closes the connection ( but not the FTP session) quit - terminates the FTP session
II. Browsing on a remote machine
dir gives a full directory listing on the remote machine dir test* - displays only files and directories whose name begins with test Is same as dir, but provides a simplified listing of filenames
III. Directories in FTP
pwd prints the name of the current remote directory cd remote-directory changes working directory on remote host cd .. moves up one level in the directory structure on the remote host lcd directory changes the default directory on the local host
IV. Types of files
Binary type this command at the FTP prompt to set binary mode before
transferring binary files For example, use binary mode with the following type of files: o SPSS System files o SAS Transport files o Stata Datasets o Graphics files (e.g., *.gif, *.jpg, *.bmp, etc.) o Microsoft Office Documents (*.doc, *.xls, etc)
ASCII type this command at the FTP prompt to set ASCII mode before
transferring text files. Use the ASCII mode with any of the following: o Raw Data (e.g., *.dat or *.txt, codebooks, or other plain text documents) o SPSS Portable files o HTML files
V. Transferring Files
get test copies file test from remote to local host (from current remote
directory to current local directory)
mget test.* data.dbf copies files beginning with test and the file named
data.dbf from remote to local host
put test - copies file test from local to remote host. You must have write access
to the remote host for this to work.
mput test.* data.dbf - copies files beginning with test and the file named
data.dbf from local to remote host
If a file name contains spaces (e.g., on your Windows system) you should type the file name in quotation marks , but it is strongly recommended to rename such files before FTPing them.
get test
more displays file test To make sure you want a document, you can display it with the more command and see the file screen by screen (using the space bar) BEFORE you get a file. To exit out of more, type q.
prompt turns off prompting for individual files when using the mget or
mput commands. If you have mistyped youe username or password, use the user cammand to relogin. For a list of all FTP commands type ? at the ftp > prompt. For a brief explanation of a command, type help, leave a space, and type the command itself.
Remote login Remote login occurs when a user connects to an Internet host to use its native user interface. In the 1970s and early 1980s, text-oriented terminals were the predominate tools for computer users. Protocols such as TELNET and RLOGIN were developed for terminal users to use their terminals as if they were directly connected to a remote system. UNIX systems, with their predominately terminal-oriented interface, still make heavy use of these protocols. Telnet is the standard Internet application protocol for remote login. It provides the encoding rules to link a users keyboard/display on a client (user) system with a command interpreter on a remote server system. In the late 1980s, as graphical, window-oriented user interface became popular, protocols were developed to allow remote windowing operations, much as earlier protocols allowed remote terminal operations.
Procedure:
Follow all the steps as shown below to setup and configure an FTP server in IIS. Step 1: Step 2: Step 3: Select Add/Remove Programs. Go to Start Menu , select Settings and then Control Panel.
In the components wizard, scroll down until you see IIS in the list. Tick on Internet Information Services(IIS) .
Click on Details and then select File Transfer Protocol (FTP) Service and then click on Next.
Go to Start, then Control Panel and click on Administrative Tools. You should now see an icon for Internet Information Services.
When you open IIS for the first time, youll only see your computer name in the left hand menu. Go ahead and click the + symbol next to the computer name and youll see a couple of options like Web Sites, FTP Sites, etc. Were interested in FTP Sites, so expand that out also. You should see Default FTP Site, click on it.
Step 8: Youll notice after you click on the default FTP site that there are a couple of buttons at the top that look like VCR buttons: Play, Stop, and Pause. If the Play button is greyed out, that means the FTP server is active. Your FTP server is now up and running! You can actually connect to it via your FTP client software.
Step 9: The default FTP site is actually located in C:\Inetpub\ftproot. The drive may be different. Locate first the Inetpub folder. Open this directory and dump some files into it.
Step 10: Now first connect to our FTP server from another computer on the network. In order to do this, youll have to open up the Windows Firewall to allow FTP connections to your computer, otherwise all external computers will be blocked. You can do this by going to Start, Control Panel and then clicking on Windows Firewall. Click on the Advanced Tab.
Step 11: Under the Network Connection Settings section, make sure all of the connections are checked in the left list and then click on the Settings button. Youll now be able to open certain ports on your computer based on the service your computer is providing. Since we are hosting our own FTP server, we want to check off FTP Server.
Step 12: A little popup window will appear with some settings that you can change, just leave it as it is and click OK. Click OK again at the main Windows Firewall window. You have now opened up the firewall for FTP connections.
Step 13: Now try to connect to your FTP site from a different computer on your network. Youll need to get the IP address of the computer first before you can connect into it from a different computer. Go to Start, click Run and type in CMD. Type IPCONFIG and jot down the number for IP Address:
Step 14: In your FTP client on the other computer, type in the IP Address you just wrote down and connect anonymously. For this go to command prompt & type ftp & IP address of the server. Enter username Anonymous & just enter at the passwaord. You should now be able to see all of your files just like you did on the FTP client that was on the local computer.
Step 15: Now that the FTP site is working, you can create as many folders as you like for FTP purposes. In this way, when a user connects, they specify a path that will connect to one specific folder. Back in IIS, right click on Default FTP Site and choose New, and then Virtual Directory.
Step 16: When you create a virtual directory in IIS, youre basically going to create an alias that points to a folder on the local hard drive. So in the wizard, the first thing youll be asked is for a alias name. Make is something simple and useful like Cnftp etc.
Step 17:
Click Next and now browse to the path where you want the alias to refer to. So if you have a bunch of movies you want to share, browse to that folder.
Step 18: Click Next and choose whether you want it as Read access only or Read and Write access. If you simply want to share files, check Read. If you want people to be able to upload files to your computer, choose Read and Write.
Step 19: Try out various ftp commands for transferring files. Follow all the steps as shown below for Telnet. Step 1: Step 2: Step 3: Step 4: Step 5: Step 6: Step 7: Step 8: Telnet Properties screen will appear. Select startup type automatic and click on OK. Right click on Telnet and select Properties. In the services list, scroll down until you see Telnet in the list. Right click on Telnet & click on start to start the Telnet service. Click on services. Click on Administrative Tools. Click on Performance and Maintenance . Go to Start Menu , select Settings and then Control Panel.
Now first connect to our Telnet server from another computer on the network. In order to do this, youll have to open up the Windows Firewall to allow Telnet connections to your computer, otherwise all external computers will be blocked. You can do this by going to Start, Control Panel and then clicking on Windows Firewall. Click on the Advanced Tab.
Step 9: Under the Network Connection Settings section, make sure all of the connections are checked in the left list and then click on the Settings button. Youll now be able to open certain ports on your computer based on the service your computer is providing. Since we are hosting our own Telnet server, we want to check off Telnet Server.
Step 12: A little popup window will appear with some settings that you can change, just leave it as it is and click OK. Click OK again at the main Windows Firewall window. You have now opened up the firewall for Telnet connections.
Step 13: Now try to connect to your Telnet server from a different computer on your network. Youll need to get the IP address of the computer first before you can connect into it from a different computer. Go to Start, click Run and type in CMD. Type IPCONFIG and jot down the number for IP Address:
Step 14: A Telnet session can be initiated using the Telnet command. For this simply type: telnet IP address.
Step 15: Also just type at command prompt telnet, then various options and subcommands are available. And the window appears as follows. Try various commands of Telnet on this prompt.