Tải bản đầy đủ (.pdf) (149 trang)

Sun Fundamentals of Solaris 7 EU-118 Student Guide With Instructor Notes phần 10 potx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (769.72 KB, 149 trang )

17
17-8 Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
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
]
17
Network Basics 17-9
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Using the rlogin Command
Overview
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.
$
17
17-10 Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Using the rlogin Command
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
17
Network Basics 17-11
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Using the rlogin Command
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.
$
17
17-12 Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Using the rlogin Command
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.
$
17
Network Basics 17-13
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Using the rlogin Command
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.
Either variant will return you to the dtlogin screen, enabling you to
start a new CDE session.
17
17-14 Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
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.

17
Network Basics 17-15
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Network Commands
Using the ftp Command
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
17
17-16 Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
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.
17
Network Basics 17-17
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Using the rusers 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
$
17
17-18 Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
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.
17
Network Basics 17-19
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
The NIS+ Naming Service
Decentralized Administration
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 Solaris 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. They are covered more fully in the
SA-287: Solaris 7 System Administration II and advanced networking
courses.
17
17-20 Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
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.
17
Network Basics 17-21
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
The NFS System
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
17
17-22 Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
The NFS System
NFS Client
The NFS system client:
● Mounts the desired file system which has been authorized by the
NFS system server
● 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
17
Network Basics 17-23
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
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 directory are you placed on the remote machine?
___________________________________________________________
2. Issue the command that shows you the hostname of the current
machine.
3. Log out of the remote machine. Display the hostname of your
current machine to determine if you are back to your own host.
4. Use the rlogin command and option to log in to another machine
as the user guest with a password of guest (or as another user as
specified by your instructor).
5. Log out of the remote machine.
Workshop Lab
Use what you have learned so far in this course to work through the
following:
1. Start the find command that was previously stopped.
2. Log in to your machine from another student’s machine and kill
the find command.
17
17-24 Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Performing Basic Network Commands
Exercise Summary
Discussion – Take a few minutes to discuss what experiences, issues,
or discoveries you had during the lab exercises.


Manage the discussion here based on the time allowed for this module, which was given
in the “About This Course” module. If you find you do not have time to spend on
discussion, then just highlight the key concepts students should have learned from the
lab exercise.
● Experiences

Ask students what their overall experiences with this exercise have been. You might want
to go over any trouble spots or especially confusing areas at this time.
● Interpretations

Ask students to interpret what they observed during any aspects of this exercise.
● Conclusions

Have students articulate any conclusions they reached as a result of this exercise
experience.
● Applications

Explore with students how they might apply what they learned in this exercise to
situations at their workplace.
17
Network Basics 17-25
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Performing Basic Network Commands
Exercise Solutions
Complete the following steps:
1. Use the rlogin command to log in to another machine in your
classroom.
$ rlogin
hostname
In what directory are you placed on the remote machine?

A home directory on the remote machine (either /home/
username
or
/export/home/
username
) or the root directory (/) if no home
directory exists.
2. Issue the command that shows you the hostname of the current
machine.
$ uname -n
3. Log out of the remote machine. Display the hostname of your
current machine to determine if you are back to your own host.
$ exit
$ uname -n
4. Use the rlogin command and option to log in to another machine
as the user guest with a password of guest.
$ rlogin
hostname
-l guest
5. Log out of the remote machine.
$ exit
17
17-26 Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Check Your Progress
Before continuing on to the next module, check that you are able to
accomplish or answer the following:
❑ 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
17
Network Basics 17-27
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Think Beyond
What other advantages of a networked environment can you think of?
18-1
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
MailToolandCalendar Manager
18
Objectives
Upon completion of this module, you should be able to:
● Describe the main features of the Mail Tool
● Compose and send an electronic mail (email) message
● Read an electronic mail message
● Respond to a mail message
● Delete and undelete mail messages
● Set mail aliases
● Create alternate mailboxes
● Attach files to mail messages
● Describe the major functions of the Calendar Manager
● Add appointments to your calendar
● View your calendar in the four formats: Day, Week, Month, and
Year
● Set Calendar options
18
18-2 Fundamentals of Solaris 7

Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Relevance

Present the following question to stimulate the students and get them thinking about the
issues and topics presented in this module. While they are not expected to know the
answer to the question, the answer should be of interest to them and inspire them to learn
the content presented in this module.
Discussion – What types of information do you send through email?
Do you need to send only text, or files in various formats? Do you save
messages?
What advantages can you see to keeping a calendar of appointments
on your system? Would you want to make this calendar available to
other users in your group?
18
Mail Tool and Calendar Manager 18-3
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
The Mail Icon and Mail Window
The Mail icon
on the Front
Panel
The Mail icon
showing new
mail has been
List of received
email messages
Message viewing
area
received
18
18-4 Fundamentals of Solaris 7

Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
The Mail Window
By default, the Mail window is divided into two portions.
The upper portion displays a list of the email messages which have
been received.
The lower portion displays the text content of the currently
highlighted message. This allows you to view each message’s contents
by clicking once on an email subject header line in the upper portion.

×