Network Basics

14 302 0
Network Basics

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Network Basics Objectives Upon completion of this module, you should be able to: • Describe the terms client-server and distributed processing • Open a session on a remote machine using telnet • Log in remotely to another machine on the network • Use ftp to get a file from a remote system • Identify users logged in on the local network • Describe the concept of naming services Discussion – What network features do you use now? What do you think would be the advantages of being connected to other users, or a central file server?  Important – This is a fundamentals class, basically aimed at end-users. This module is intended as an introduction to network commands only. It is strongly suggested that you do not teach the system administration files used for networking here. That topic is fully covered in the SA-287 course and not intended for this audience.  Be sure you have a naming service running so the students can use the rlogin and rusers commands. Client-Server Example Networking Environment Figure 17-1 shows a sample networking environment with workstations, a printer, and so on. Figure 17-1 Example Linux Networking Environment  You may want to explain to the students the difference between having access to a naming service and not having access to a naming service. You cannot assume that students will have access when they go back to their working environment.  If you are not running a naming service, the host name and IP address must be recognized by the remote system as being in the /etc/hosts file.  If the user does not have a home directory on the remote machine, the user is automatically placed in the root (/ ) directory. Distributed Processing Distributed processing enables access to remote systems for the purpose of sharing information and network resources. It also enables communication with users on other systems. Network A network is a connection that enables an exchange of information between machines. Two types of networks are: • Local area network (LAN) – A network that covers a small area, usually less than a few thousand feet. • Wide area network (WAN) – A network that can span thousands of miles. Host A host is a computer system on a network. The local host is the machine on which the user is currently working. A remote host is a system that is being accessed by a user from another system. Server A server provides resources to one or more clients by means of a network. Client A client is a machine that uses the services from one or more servers on a network. Naming Services Sometimes it is useful to have a common user and group list for hosts on a network. In such situations, a naming service can be implemented by the sytem administrator. A naming service allows users to be recognized by all remote machines on the network. If the system administrator on your network chooses not to use a naming service, you must have an account on a remote machine in order to log in to it. Network Commands telnet telnet is an application that is part of the Linux environment. It utilizes Transmission Control Protocol/Internet Protocol (TCP/IP) to connect to another system. The telnet server simulates a terminal in order to authorize a user to connect to a remote system and work in that environment. When using telnet, you can: • Open a session on a remote machine • Alternate between the remote session and the local session • Access machines that do not run under the UNIX environment The following is an example of using telnet to connect to a remote system called beach: $ telnet beach Trying 192.9.49.10 . Connected to beach Escape character is ‘^]’. 4.2 BSD UNIX (beach) login: jdupont Password: Last login: Wed Jun 1 19:03:33 on console beach% (Enter commands) beach% exit Connection closed by foreign host $ The following is an example of using telnet to alternate between the remote session and a local session: $ telnet beach Trying 192.9.49.10 . Connected to beach Escape character is ‘^]’. 4.2 BSD UNIX (beach) login: jdupont Password: Last login: Wed Jun 1 19:08:15 on console beach% ^] telnet> ! $ pwd /home/user2 $ exit beach% exit Connection closed by foreign host Using the rlogin Command Overview Use the rlogin command to establish a remote login session on another workstation. Remotely logging in to a workstation is helpful under the following circumstances: • To access information on another workstation that is not available otherwise • To access your workstation remotely to read mail. • To kill a process that has caused your workstation to hang Command Format rlogin hostname [-option] Remotely Logging in to Another Host $ rlogin saturn Password: Last login: Mon Dec 21 11:04:27 from venus Sun Microsystems Inc. SunOS 5.7 Generic October 1998 $ id uid=102(user2) gid=10(staff) $ uname -n saturn $ pwd /home/user2 $ exit Connection closed. $ Specifying a Different Login ID Use the -l option to specify a different login ID for the remote login session. The system administrator can set up a guest account so users can remotely log on to a server. Command Format rlogin hostname -l username Before attempting to remotely log in to another system as a different user, be sure you have an account on the desired remote machine. Check with your system administrator if you do not have an account on the remote machine. The information you will need to know is: • Machine name • Login ID • Password of the new account Logging in Remotely as Another User $ rlogin saturn -l user15 Password: Last login: Mon Dec 21 11:04:27 from venus Sun Microsystems Inc. SunOS 5.7 Generic October 1998 You have mail. $ id uid=115(user15) gid=10(staff) $ pwd /home/user15 $ exit Connection closed. $ Terminating a Local Process From a Remote Machine When your system is not responding and you do not want to reboot, you may be able to kill a process on your system remotely by logging on to another machine and using the rlogin command to access your system. For example: $ rlogin hostname Password: Last login: Tue Jun 8 17:40:30 from venus Sun Microsystems Inc. SunOS 5.7 Generic October 1998 You have mail. $ ps -e PID TTY TIME CMD 10153 console 0:03 cm 12892 console 0:01 sh 217 term/a 0:0 /usr/lib/lpsched 14490 pts/2 0:03 maker3ol 12932 pts/0 0:01 /bin/sh 13162 pts/7 0:08 admintool 10138 console 0:04 clock 10159 console 7:29 mailtool 10140 pts/1 0:05 cmdtool 10151 console 12:42 xnews 10614 pts/1 0:27 cmdtool 10109 console 0:00 xinit $ kill 14490 $ exit Connection closed. $ Using rlogin and pkill to Recover From a “Hung” CDE Session When your workstation does not appear to be responding to mouse or keyboard input, the odds are excellent that the problem stems from within your CDE session as opposed to the underlying operating system itself. In such cases, you can use another workstation to access your workstation via rlogin (or telnet) and then use the pkill command to terminate the corrupted CDE session; all without rebooting your workstation. $ rlogin hostname Password: Last login: Fri Jul 9 16:50:30 from barney Sun Microsystems Inc. SunOS 5.7 Generic October 1998 $ pkill -9 loginshell If you do not know your default shell, type the following command: $ pkill -9 ‘basename $SHELL‘ which will determine and terminate all instances of your login shell for you. Network Commands Using the ftp Command The ftp command (part of an industry-standard application called FTP, or File Transfer Protocol) is used to transfer files using ASCII or binary mode between systems using similar or dissimilar operating systems. Servers with sites set up for downloading files sometimes provide an anonymous ftp account so users can pull files off the server. For this kind of an account, at the Name prompt, the word anonymous is entered instead of accepting the default displayed. If a password is required for the anonymous account, it will usually be your full email address. Once you have successfully used ftp to access a remote site, some familiar file and directory access commands like cd and ls are available. If permissions are set by the site’s system administrator for a user to see the contents of a directory, the ls command will display files in that directory. If permissions are set such that a user does not have access to the files, when the ls command is entered, a prompt will be returned in response. As on your local system, cd will change directories on the remote system. If it is necessary for you to change directories on your own system in the middle of the ftp session, the lcd (local change directory) command can be used. To end an ftp session, type bye at the prompt. $ ftp venus Connected to 129.150.212.16. 220 venus FTP server (UNIX(r) System V Release 4.0) ready. Name (129.150.212.16:lister): Return <CR> 331 Password required for lister. Password: xxx 230 User lister logged in. ftp> cd /etc/inet 250 CWD command successful. ftp> bin 200 Type set to I. ftp> get hosts /tmp/hosts 200 PORT command successful. 150 Binary data connection for hosts (129.159.129.38,33425) (77 bytes) 226 Transfer complete. local: /tmp/hosts remote: hosts 77 bytes received in 0.0014 seconds (5,25 Kbytes/s) ftp> bye Using the rusers Command Use the rusers command to see who is logged in on the local network. Command Format rusers [-option(s)] [hostname] Displaying Remote Users on a Network $ rusers Sending broadcast for rusersd protocol version 3 . localhost user2 saturn user3 Sending broadcast for rusersd protocol version 2 . $ If your network is busy or there are many hosts on the network, this command can take quite a while to complete its output. Press Control-c to abort the command. Displaying Remote Users on a Network If you want to see whether a specific user is logged in, specify the user’s host name. $ rusers saturn saturn user3 $ Use the -l option to get a longer listing in the style of the who command. $ rusers -l Sending broadcast for rusersd protocol version 3 . user3 saturn:console May 24 08:33 user2 localhost:console May 24 08:33 Sending broadcast for rusersd protocol version 2 . $ The NIS+ Naming Service The goal of the NIS+ naming service is to allow centralization of network administration. Decentralized Administration The administration of a group of machines grows in complexity with the number of machines and users to manage. Thus, decentralized administration is conceivable for two or three machines, it becomes more complex if the number exceeds that limit. For example, imagine a group of five machines. If all the users have to be able to log in as themselves on each machine, the administrator must duplicate the /etc/passwd on every machine. Although putting this in place initially is possible, maintenance becomes difficult. In effect, each modification of one element of the password file makes it necessary to reproduce the change on each machine. The problem that is raised by the /etc/password file is exponentially increased by necessary changes to many other administrative files, such as the groups and hosts files. Centralized Administration It is advisable for administrators to set up networks with a centralized administration that distributes a database to all the machines known by the distributed administration. This database can be centralized on one server, which provides the administrative services. The group of machines using the database on the server is called a domain. This centralized administration uses a naming service as the framework for the domain(s). NIS (Network Information Service) and NIS+ are two naming services that can be set up for use in the Linux networked environment. Note – This section and the following one on NFS™ are intended as introductions to some networking concepts. The topics are in no way addressed completely in this class. The NFS System The NFS system is Sun’s distributed computing file system. It is a network service that allows users to transparently access files and directories located on another disk on the network. NFS Server The NFS system server: • Has a local disk • Allows access to the resources on the disk to machines with specified permissions (restrictions) • Responds to requests from diverse clients • Does not maintain any status information about the files opened by clients, so there are no dependencies between server and clients • Can serve clients of other servers and be an NFS client itself [...]... Reads or writes to files on the NFS server • Maintains open files • Can access many NFS servers and be an NFS server, if it has a local disk Exercise: Performing Network Basics Exercise objective – In this exercise you will use some of the networking commands introduced in this module Tasks Complete the following steps: 1 Use the rlogin command to log in to another machine in your classroom In what... distributed processing  Open a session on a remote machine using telnet  Log in remotely to another machine on the network  Use ftp to get a file from a remote system  Identify users logged in on the local network  Describe the concept of naming services Think Beyond What other advantages of a networked environment can you think of? . of networks are: • Local area network (LAN) – A network that covers a small area, usually less than a few thousand feet. • Wide area network (WAN) – A network. purpose of sharing information and network resources. It also enables communication with users on other systems. Network A network is a connection that enables

Ngày đăng: 02/10/2013, 09:20

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan