ВМСС_часть1 / vmss_lab1
.pdfЧасть 1. Основы работы в OC UNIX
1. Подключение к удаленному UNIX-серверу: login as: stud5 stud5@srv-vmss.camheds.com's password:
2. Просмотр содержимого домашнего каталога, в том числе скрытых файлов, содержащихся в нем:
[stud5@srv-vmss ~]$ ls -a Результат:
. .bash_history .bash_profile .cloud-locale-test.skip skat
.. .bash_logout .bashrc mbox
Следовательно, в папке всего содержится 9 файлов.
3. Просмотр содержимого домашнего каталога, в том числе прав доступа и скрытых файлов:
[stud5@srv-vmss ~]$ ls -l -a |
|
||
Результат: |
|
|
|
total 32 |
|
|
|
drwx------ |
3 stud5 stud5 4096 Sep 25 09:34 . |
||
drwxr-xr-x. 22 root root |
4096 Sep 19 16:20 .. |
||
-rw------- |
1 stud5 stud5 3395 Sep 25 09:34 .bash_history |
||
-rw-r--r-- |
1 stud5 stud5 |
18 Mar 23 |
2017 .bash_logout |
-rw-r--r-- |
1 stud5 stud5 |
176 Mar 23 |
2017 .bash_profile |
-rw-r--r-- |
1 stud5 stud5 |
124 Mar 23 |
2017 .bashrc |
-rw-r--r-- |
1 stud5 stud5 |
0 Sep 18 15:28 .cloud-locale-test.skip |
|
-rw-rw-r-- |
1 stud5 stud5 613 Sep 25 08:55 mbox |
drwxrwxr-x 2 stud5 stud5 4096 Sep 25 08:41 skat
Таким образом, в результате применения команды помимо названий файлов отобразились дополнительные сведения о них, включая права доступа.
4.Создание своего каталога: [stud5@srv-vmss ~]$ mkdir mycat
5.Переход в свой каталог: [stud5@srv-vmss ~]$ cd mycat
Часть 2. Изучение команд протокола TELNET
1. Вывод справочных сведений по утилите TELNET: |
|
|
[stud5@srv-vmss mine]$ man telnet |
|
|
Результат: |
|
|
TELNET(1) |
BSD General Commands Manual |
TELNET(1) |
NAME
telnet - user interface to the TELNET protocol
SYNOPSIS
telnet [-8EFKLacdfrx] [-X authtype] [-b hostalias] [-e escapechar] [-k realm] [-l user] [-n tracefile] [host [port]]
DESCRIPTION
The telnet command is used to communicate with another host using the
TELNET protocol. If telnet is invoked without the host argument, it enters command mode, indicated by its prompt (telnet>). In this mode, it accepts and executes the commands listed below. If it is invoked with arguments, it performs an open command with those arguments.
The options are as follows:
-7 Strip 8th bit on input and output. Telnet is 8-bit clean by
default but doesn’t send the TELNET BINARY option unless forced.
-8 Specifies an 8-bit data path. This causes an attempt to negotiate the TELNET BINARY option on both input and output.
-E Stops any character from being recognized as an escape character.
-F If Kerberos V5 authentication is being used, the -F option allows the local credentials to be forwarded to the remote system, including any credentials that have already been forwarded into the local environment.
-K Specifies no automatic login to the remote system.
-L Specifies an 8-bit data path on output. This causes the BINARY option to be negotiated on output.
-X atype
Disables the atype type of authentication.
:
Таким образом, в результате выполнения команды было выведено описание утилиты TELNET.
2.Запуск утилиты TELNET из командной строки UNIX: [stud5@srv-vmss mine]$ telnet
3.Просмотр списка команд утилиты TELNET:
telnet> help Результат:
Commands may be abbreviated. Commands are:
close |
close current connection |
logout |
forcibly logout remote user and close the connection |
display |
display operating parameters |
mode |
try to enter line or character mode ('mode ?' for more) |
open |
connect to a site |
quit |
exit telnet |
send |
transmit special characters ('send ?' for more) |
set |
set operating parameters ('set ?' for more) |
unset |
unset operating parameters ('unset ?' for more) |
status |
print status information |
toggle |
toggle operating parameters ('toggle ?' for more) |
slc |
change state of special charaters ('slc ?' for more) |
zsuspend telnet
2
!invoke a subshell
environ |
change environment variables ('environ ?' for more) |
?print help information
Таким образом, в результате выполнения команды был выведен список команд утилиты TELNET и их краткое описание.
Просмотр справки по команде SET: telnet> set ?
Результат: |
|
|
echo |
|
character to toggle local echoing on/off |
escape |
|
character to escape back to telnet command mode |
rlogin |
|
rlogin escape character |
tracefile |
|
file to write trace information to |
The following need 'localchars' to be toggled true |
||
flushoutput |
character to cause an Abort Output |
|
interrupt |
|
character to cause an Interrupt Process |
quit |
character to cause an Abort process |
|
eof |
character to cause an EOF |
|
The following are for local editing in linemode |
||
erase |
|
character to use to erase a character |
kill |
character to use to erase a line |
|
lnext |
|
character to use for literal next |
susp |
|
character to cause a Suspend Process |
reprint |
|
character to use for line reprint |
worderase |
|
character to use to erase a word |
start |
character to use for XON |
|
stop |
|
character to use for XOFF |
forw1 |
|
alternate end of line character |
forw2 |
|
alternate end of line character |
ayt |
alternate AYT character |
|
autoflush |
|
enable flushing of output when sending interrupt characters |
autosynch |
|
enable automatic sending of interrupt characters in urgent mode |
skiprc |
|
enable don't read ~/.telnetrc file |
binary |
|
enable sending and receiving of binary data |
inbinary |
|
enable receiving of binary data |
outbinary |
|
enable sending of binary data |
crlf |
enable sending carriage returns as telnet <CR><LF> |
|
crmod |
|
enable mapping of received carriage returns |
localchars |
|
enable local recognition of certain control characters |
debug |
|
enable debugging |
netdata |
|
enable printing of hexadecimal network data (debugging) |
prettydump |
enable output of "netdata" to user readable format (debugging) |
|
options |
|
enable viewing of options processing (debugging) |
termdata |
|
enable (debugging) toggle printing of hexadecimal terminal data |
?display help information
Таким образом, в результате применения команды был выведен список обозначений для аргументов этой команды и пояснения к ним.
3
Просмотр справки по команде SEND: telnet> send ?
Результат:
ao |
Send Telnet Abort output |
ayt |
Send Telnet 'Are You There' |
brk |
Send Telnet Break |
ec |
Send Telnet Erase Character |
el |
Send Telnet Erase Line |
escape |
Send current escape character |
ga |
Send Telnet 'Go Ahead' sequence |
ip |
Send Telnet Interrupt Process |
nop |
Send Telnet 'No operation' |
eor |
Send Telnet 'End of Record' |
abort |
Send Telnet 'Abort Process' |
susp |
Send Telnet 'Suspend Process' |
eof |
Send Telnet End of File Character |
synch |
Perform Telnet 'Synch operation' |
getstatus |
Send request for STATUS |
?Display send options
Таким образом, в результате применения команды был выведен список обозначений для аргументов этой команды и пояснения к ним.
4. Установление связи с удаленным сервером при помощи команды OPEN: telnet> open srv-vmss.camheds.com 58022
Результат:
Trying 138.68.69.115...
Connected to srv-vmss.camheds.com. Escape character is '^]'. SSH-2.0-OpenSSH_5.3
^]
10. Закрытие соединения командой CLOSE: telnet> close
Результат:
Connection closed.
Следовательно, сеанс связи закрыт.
Часть 3. Работа в режиме “Терминал - терминал”
1.Отправление сообщения на другой терминал с помощью команды write: [stud5@srv-vmss mine]$ write stud4
testmessage.
2.Установление терминала недоступным для приема сообщений: [stud5@srv-vmss mine]$ mesg n
Попытка отправить сообщение на недоступный терминал: [stud5@srv-vmss mine]$ write stud1
Результат:
write: you have write permission turned off.
Следовательно, при попытке отправить сообщение на недоступный для приема сообщений терминал выводится сообщение об отсутствии разрешения на отправление сообщения.
4
3. Установление терминала доступным для приема сообщений: [stud5@srv-vmss mine]$ mesg y
Организация беседы при помощи команды talk: [stud5@srv-vmss mine]$ talk stud1
Часть 4. Работа с электронной почтой в UNIX
1.Отправление письма на другой терминал при помощи команды mail: [stud5@srv-vmss mine]$ mail stud1
Subject: test New message
.
Результат: EOT
Таким образом, было выведено сообщение об завершении выполнения задачи.
2.Просмотр полученных писем:
[stud5@srv-vmss mine]$ mail Результат:
Heirloom Mail version 12.4 7/29/08. Type ? for help. "/var/spool/mail/stud5": 3 messages 3 new
>N 1 stud1@srv-vmss.camhe Fri Sep 25 08:45 18/587 "sb"
N2 Mail Delivery System Fri Sep 25 08:48 74/2329 "Undelivered Mail Retu"
N3 stud9@srv-vmss.camhe Fri Sep 25 08:53 18/603 "privitic" Следовательно, получено 3 письма.
Отправление ответа на первое письмо: & r
To: stud1@srv-vmss.camheds.com stud5@srv-vmss.camheds.com Subject: Re: sb
stud1@srv-vmss.camheds.com wrote:
> eda prishlo
.
Результат: EOT
Таким образом, было выведено сообщение об завершении выполнения задачи.
3.Сохранение письма в файле: & s
Результат:
"/home/stud5/mbox" [Appended] 20/608
Таким образом, в результате выводится сообщении о добавлении письма в файл.
4.Удаление письма с номером 3:
&d 3
&q Результат:
Held 2 messages in /var/spool/mail/stud5
5
You have mail in /var/spool/mail/stud5
Таким образом, в результате выводится сообщении о наличии двух сообщений в почтовой системе.
5. Просмотр всех файлов, используемых почтовой системой UNIX: [stud5@srv-vmss mine]$ ls -l -a
Результат: total 8
drwxrwxr-x 2 stud5 stud5 4096 Sep 30 09:00 . drwx------ 4 stud5 stud5 4096 Sep 30 09:00 ..
6