Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 149 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
149
Dung lượng
769,72 KB
Nội dung
17 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: q To access information on another workstation that is not available otherwise q To access your workstation remotely to read mail q To kill a process that has caused your workstation to hang Command Format rlogin hostname [-option] 17-8 Fundamentals of Solaris Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D 17 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 $ Network Basics 17-9 Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D 17 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-10 Fundamentals of Solaris Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D 17 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 not have an account on the remote machine The information you will need to know is: q Machine name q Login ID q 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 $ Network Basics 17-11 Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D 17 Using the rlogin Command Terminating a Local Process From a Remote Machine When your system is not responding and you 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 17:40:30 Sun Microsystems Inc SunOS 5.7 You have mail $ ps -e PID TTY 10153 console 12892 console 217 term/a /usr/lib/lpsched 14490 pts/2 12932 pts/0 13162 pts/7 10138 console 10159 console 10140 pts/1 10151 console 10614 pts/1 10109 console $ kill 14490 $ exit Connection closed $ 17-12 from venus Generic October 1998 TIME 0:03 0:01 0:0 CMD cm sh 0:03 0:01 0:08 0:04 7:29 0:05 12:42 0:27 0:00 maker3ol /bin/sh admintool clock mailtool cmdtool xnews cmdtool xinit Fundamentals of Solaris Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D 17 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 16:50:30 from barney Sun Microsystems Inc SunOS 5.7 Generic October 1998 $ pkill -9 loginshell If you 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 Network Basics 17-13 Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D 17 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-14 Fundamentals of Solaris Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D 17 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 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 Network Basics 17-15 Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D 17 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 localhost user2 saturn user3 Sending broadcast for rusersd protocol version $ 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-16 Fundamentals of Solaris Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D 17 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 user3 user2 Sending broadcast $ Network Basics for rusersd protocol version saturn:console May 24 08:33 localhost:console May 24 08:33 for rusersd protocol version 17-17 Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D F Edit Menu Options The Edit menu contains the standard options to manipulate text, such as Cut, Copy, and Paste The Find option enables you to find text or to find and change text It is case sensitive, so anything you are searching for will only be found if it is an exact match Similarly, any text can be changed to be exactly the same as the text you typed in the change box, as shown in the example on page F-7 If the text string cannot be found in the document, you will see the following window: F-8 Fundamentals of Solaris Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D F Replacing Text The Text Editor F-9 Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D F Replacing Text Text can be selected in order to be replaced using any of the following four methods: q Dragging over the text while pressing the left mouse button This will highlight all of the text the mouse pointer passes over q Double-clicking with the left mouse button on a word to highlight that word q Treble-clicking with the left mouse button to highlight the paragraph over which the mouse pointer is situated q Quadruple-clicking with the left mouse button to highlight all of the text in the current Text Editor file Once text has been highlighted using any of these four methods, it will be replaced by whatever characters are next typed at the keyboard F-10 Fundamentals of Solaris Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D F Replacing Text Instead of typing characters, you can cut, copy, or clear the highlighted text using the special keyboard keys or the options on the Text Editor Edit menu The Text Editor F-11 Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D F Format Menu Options The Settings option under the Format menu will enable you to change margins and alignment of your text, either for a paragraph or for the entire document Once settings have been defined, clicking again on the Format menu gives a shortcut to changing settings for the current paragraph or the entire document (Paragraph or All) F-12 Fundamentals of Solaris Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D F Text Editor Options The Text Editor F-13 Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D F Text Editor Options The Options menu enables you to switch between insert and overstrike modes The chosen mode will affect any new text which is being typed into an existing text area The wrap to fit mode fits the text in the current Text Editor window by automatically wrapping or moving text to the next line when it reaches the edge of the window The status line can be switched on or off, using the Status Line menu option The Backup On Save option creates an extra backup file each time you save the contents of your Text Editor session F-14 Fundamentals of Solaris Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D F Text Editor Options When the status line is on, it shows the current line number on which the cursor is situated and the total number of lines in the text.: The Text Editor F-15 Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D F F-16 Fundamentals of Solaris Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D Index Symbols * symbol 5-25, D-2 cshrc 11-13 login 11-13 /etc/profile file 11-5 > symbol 6-45 | symbol 6-47 A absolute mode 8-15 absolute path name 5-6 aliases A-13 command aliases A-13 to A-14 mail B-17 unalias A-14 C c 6-16 central processing unit 1-7 changing directories cd 5-12 changing permissions with octal (absolute) mode 8-18 to 8-21 changing your password 2-15 chmod command 8-15 client 17-5 client-server 17-3 to 17-5 command aliases A-13 command substitution !! A-8 !$ A-8 !* A-8 !number A-8 :p A-8 commands alias A-14 cancel 13-8 cat 6-8 cd 5-12 compress 15-6 cp 6-31 cp -r 6-33 echo A-3 ftp 17-14 grep 14-17 head 6-12 history A-5 to A-6 jobs 16-9 kill 16-14 lp 13-3 lpstat 13-5 lpstat -a 13-7 lpstat -d 13-6 lpstat -o 13-6 lpstat -s 13-6, 13-7 ls 5-18 ls -F 5-20 ls -l 5-21 ls -ld 5-22 ls -R 5-22 man 4-13 mkdir 6-28 more 6-10 Index-1 Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D mv 6-35 printenv A-3 ps 16-6, 16-14 pwd 5-14 rlogin 17-8 rlogin -l 17-10 rm -r 6-41 rmdir 6-41 rusers 17-16 set history A-5 set path A-4 set prompt A-12 setenv A-3 tail 6-14 touch 6-25 unalias A-14 unset 10-6 unsetenv A-3 who am i 14-25, 14-26 whoami 14-21, 14-22, 14-23 compress command 15-6 control characters 6-3 copying directories 6-33 course objectives 3-3, 18-4 CPU - central processing unit 1-7 customizing your prompt A-12 D displaying file types 5-20 hidden files 5-19 long listing 5-21 displaying files cat 6-8, 6-9, 6-11, 6-13, 6-15, 6-17, 6-48 head 6-12 more 6-10 tail 6-14 displaying files and directories ls 5-18 to 5-22 displaying printer queues 13-5 to 13-7 displaying the current directory pwd 5-14, 5-15, 5-16, 5-17 Index-2 distributed processing 17-4 E editing commands changing text 9-10 clearing the screen 9-14 copying and moving text 9-11 deleting text 9-9 finding a line 9-14 saving and quitting 9-12 searching and replacing 9-14 setting line numbers 9-13 environment variable c shell A-4 F file permissions others 8-8 file system 1-14, 1-15, 1-16 directory 1-14 subdirectory 1-14 file types 5-20 ftp command 17-14 G grep 14-18 group members 8-5 H hard disk 1-7 hidden files 5-19 history feature A-5 to A-11 I I/O 1-7 id -a 14-22 iff 6-20 initialization files 11-3 to 11-13 input/output 1-7 J jobs 16-10 Fundamentals of Solaris Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D K kernel 1-10 kill 16-14 L LAN 17-4 listing individual directories 5-22 local area network (LAN) 17-4 logging in 2-9 login directory 2-5 long listing 5-21 M mail alias B-17 canceling a mail message B-5 command line mail B-3 creating a mail alias B-17 deleting and undeleting a mail message B-10 mailx B-3 printing a mail message B-14 quitting mail B-15 reading a mail message B-6 to B-9 replying to a mail message B-11 to B-12 sending a file using mail B-16 sending mail message B-4 tilde commands B-18 to B-19 mailx B-3 main capabilities of the solaris computing environment 1-17 main components of a computer 1-5 to 1-6 managing jobs 16-9 to 16-12 metacharacters angle brackets 6-43 to 6-46 asterisk (*) 5-24, 5-25 question mark (?) 5-26, 5-27 semicolon (;) 5-30 square brackets([]) 5-28, 5-29 mkdir command 6-28 Index moving and renaming directories 6-37 mp 6-18 multitasking 1-17 multiuser 1-17 mv command 6-35 N network 17-4 network commands rcp 17-8 rlogin 17-8 to 17-13 rusers 17-6, 17-16, 17-17 O octal mode 8-15 operating system 1-8 to 1-17 others, permission category 8-5 P password requirements 2-6 path names 5-6 to 5-8 absolute 5-6 relative 5-8 permissions octal mode 8-18 standard 8-7 to 8-14 symbolic mode 8-17 user categories 8-17 position commands introduction 9-8 process control grep 14-17 job control 16-9 kill 16-14 managing jobs 16-9 to 16-12 managing system processes 16-3 processes and PIDs 16-6 to 16-8 ps 16-8 terminating processes 16-15 to 16-16 ps 16-8, 16-15 Index-3 Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D ps command 16-6 creating and saving a file-example 9-15 editing commands 9-9 to 9-12 input commands 9-7 invoking 9-6 vi modes 9-4, 9-5 R RAM 1-7 random access memory 1-7 relative path name 5-8 remote machine terminate a local process 17-12 removing directories 6-31 rm -r 6-42 removing files 6-39 rlogin 17-9, 17-11 rlogin -l 17-10 rm command 6-39 rm -r command 6-41 rmdir command 6-41 rusers 17-16 W WAN 17-4 who 14-23 who am i 14-25 who -H 14-24 who -q 14-24 wide area network (WAN) 17-4 S server 17-5 set prompt A-12 shell 1-12, 1-13 shell variable set variable A-2 symbolic mode 8-15 T touch command 6-25 U UID variable 8-9 user accounts 2-2 V variables environment 10-9 to 10-12, A-3 shell A-2 to A-4 vi advanced editing options 9-13 to 9-14 Index-4 Fundamentals of Solaris Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D Copyright 1999 Sun Microsystems Inc., 901 San Antonio Road, Palo Alto, California 94303, Etats-Unis Tous droits réservés Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignent l’utilisation, la copie, la distribution, et la décompilation Aucune partie de ce produit ou document ne peut être reproduite sous aucune forme, par quelque moyen que ce soit, sans l’autorisation préalable et écrite de Sun et de ses bailleurs de licence, s’il y en a Le logiciel détenu par des tiers, et qui comprend la technologie relative aux polices de caractères, est protégé par un copyright et licencié par des fournisseurs de Sun Des parties de ce produit pourront être dérivées du systèmes Berkeley 4.3 BSD licenciés par l’Université de Californie UNIX est une marque déposée aux Etats-Unis et dans d’autres pays et licenciée exclusivement par X/Open Company Ltd Sun, Sun Microsystems, le logo Sun, Solaris, AnswerBook, AnswerBook2, SunOS, ONC, OpenWindows, et HotJava sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc aux Etats-Unis et dans d’autres pays Toutes les marques SPARC sont utilisées sous licence sont des marques de fabrique ou des marques déposées de SPARC International, Inc aux Etats-Unis et dans d’autres pays Les produits portant les marques SPARC sont basés sur une architecture développée par Sun Microsystems, Inc PostScript est une marque de fabrique d’Adobe Systems, Incorporated, laquelle pourrait étre déposée dans certaines juridictions L’interfaces d’utilisation graphique OPEN LOOK et Sun™ a été développée par Sun Microsystems, Inc pour ses utilisateurs et licenciés Sun reconnt les efforts de pionniers de Xerox pour larecherche et le développement du concept des interfaces d’utilisation visuelle ou graphique pour l’industrie de l’informatique Sun détient une licence non exclusive de Xerox sur l’interface d’utilisation graphique Xerox, cette licence couvrant également les licenciés de Sun qui mettent en place l’interface d’utilisation graphique OPEN LOOK et qui en outre se conforment aux licences écrites de Sun L’accord du gouvernement américain est requis avant l’exportation du produit Le système X Window est un produit de X Consortium, Inc LA DOCUMENTATION EST FOURNIE “EN L’ETAT” ET TOUTES AUTRES CONDITIONS, DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L’APTITUDE A UNE UTILISATION PARTICULIERE OU A L’ABSENCE DE CONTREFAÇON Please Recycle ... 17: 40:30 Sun Microsystems Inc SunOS 5 .7 You have mail $ ps -e PID TTY 101 53 console 12892 console 2 17 term/a /usr/lib/lpsched 14490 pts/2 12932 pts/0 13162 pts /7 101 38 console 101 59 console 101 40... Format rlogin hostname -l username 17- 10 Fundamentals of Solaris Copyright 1999 Sun Microsystems, Inc All Rights Reserved Enterprise Services August 1999, Revision D 17 Using the rlogin Command Before... pts/1 101 51 console 106 14 pts/1 101 09 console $ kill 14490 $ exit Connection closed $ 17- 12 from venus Generic October 1998 TIME 0:03 0:01 0:0 CMD cm sh 0:03 0:01 0:08 0:04 7: 29 0:05 12:42 0: 27 0:00