Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Linux+ Certification Bible.pdf
Скачиваний:
46
Добавлен:
15.03.2015
Размер:
3.78 Mб
Скачать

338 Part IV Administration

[ws001]

 

 

XSERVER

= XF86_SVGA

X_MOUSE_PROTOCOL

= “Microsoft”

X_MOUSE_DEVICE

= “/dev/ttyS1”

X_MOUSE_RESOLUTION = 50

X_MOUSE_BUTTONS

= 3

X_MOUSE_BAUD

 

= 1200

[ws002]

 

 

XSERVER

= XF86_Mach64

[ws003]

 

 

XSERVER

= XF86_SVGA

X_COLOR_DEPTH

 

= 24

USE_XFS

= N

 

[ws004]

 

 

UI_MODE

= CHAR

These parameters are used to create a basic configuration that allows the creation of terminals. These terminals may be GUI-based and can be configured to perform all the tasks required by the clients.

Monitoring remote connections

4.11 Use network commands to connect to and manage remote systems (e.g., telnet, ftp, ssh, netstat, transfer files, redirect Xwindow)

FTP, HTTP, TELNET, and ssh create remote connections to a system. They allow you to be able to login and use the remote machine as if you were sitting physically at the console.

Telnet

Telnet is a terminal emulation program for clients running on TCP/IP networks. It connects you to a terminal on another machine. This connection allows you to enter commands on that machine as if you were at the actual physical console. To connect to a host called server1, you would enter the command:

telnet server1

You should then receive a login prompt from where you can log into the system and start entering commands. To exit out of the telnet command, you simply have to logout, or use the quit command.

FTP

FTP (File Transfer Protocol) is a protocol that is part of the TCP/IP suite. It allows you to connect to a remote host and transfer files to or from the remote host. For example, to connect to a host called server1, you would enter the command:

Chapter 10 Linux Terminals and Shells 339

ftp server1

This command will connect you to the FTP server process on server1, which will prompt you with a login. Once logged into the system, you can use the cd and ls commands to traverse and examine the directories on the system. Retrieving files from the remote host is accomplished by the get command. Uploading a file to the host is accomplished by using the put command.

SSH

SSH (secure shell) is similar to telnet, in that you use it to connect to a remote machine, but in this case, the communications and authentication are encrypted to prevent someone from listening in to the session.

X remote login

The X Windows system allows for remote X logins to other hosts, and also allows the ability of a client to run an X Windows session on another machine. For example, if you need to start an X login with server1, you would use the command:

X -query server1

You can also redirect your own display to a remote host, as long as the appropriate permissions are in place. For example, your client (client1) wants to open up an X Window on server that is from your client machine. First, the server has to give you permissions to do this:

xhost + client1

Now, you have to use the DISPLAY command to export your display:

DISPLAY=server1:0 xterm &

This command starts xterm in background mode (&), so you will not interfere with the main X session that is running on the server.

Netstat

The connections from these services, such as telnet, ssh, and ftp, may require detection by an administrator, so that any unauthorized attempts at logging in can be seen and logged. One of the most common tools used to perform this task is netstat. The netstat command provides information similar to the following:

[user@dhcppc1 user]$ netstat

 

 

 

 

Active Internet connections (w/o servers)

 

Proto Recv-Q Send-Q Local Address

 

Foreign Address

State

tcp

0

0

192.168.0.7:telnet

192.168.0.8:blackjack ESTABLISHED

tcp

0

20 192.168.0.7:ssh

 

192.168.0.6:1137 ESTABLISHED

Active UNIX domain sockets (w/o servers)

 

Proto RefCnt Flags

Type

State

I-Node Path

 

unix 8

 

[ ]

DGRAM

 

10679 /dev/log

 

340 Part IV Administration

unix 2

[ ]

DGRAM

16916

 

 

unix 3

[ ]

STREAM

CONNECTED

16330

/tmp/.X11-unix/X0

unix 3

[ ]

STREAM

CONNECTED

16329

 

unix 3

[ ]

STREAM

CONNECTED

16321

/tmp/.font-unix/fs-1

unix 3

[ ]

STREAM

CONNECTED

16320

 

unix 3

[ ]

STREAM

CONNECTED

16322

/tmp/.X11-unix/X0

unix 3

[ ]

STREAM

CONNECTED

16317

 

unix 2

[ ]

DGRAM

15166

 

 

unix 2

[ ]

DGRAM

14346

 

 

unix 2

[ ]

DGRAM

11463

 

 

unix 2

[ ]

DGRAM

10704

 

 

unix 2

[ ]

DGRAM

10691

 

 

unix 2

[ ]

STREAM

CONNECTED

10101

 

This output shows some of the current active UNIX domain sockets and remote hosts. In this example, the remote hosts use TELNET and ssh to connect to the system. Netstat is a powerful tool that uses the options shown in Table 10-1.

 

Table 10-1

 

Netstat Options

 

 

Option

Description

 

 

No Options

By default, netstat displays a list of open sockets.

 

 

-a --all

Shows both listening and non-listening sockets.

 

 

-A --protocol=family

Specifies the address families for which connections are to be

 

shown.

 

 

-c --continuous

Causes netstat to print the selected information every second

 

continuously.

 

 

-C

Prints the routing information from the route cache.

 

 

-e --extend

Displays additional information.

 

 

-F

Prints routing information from the FIB.

 

 

-g --groups

Displays multicast group membership information for IPv4 and

 

IPv6.

 

 

-I --interface=iface

Displays a table of all network interfaces, or the specified iface.

 

 

-l --listening

Shows only listening sockets.

 

 

-M --masquerade

Displays a list of masqueraded connections.

 

 

-n --numeric

Shows numerical addresses instead of trying to determine

 

symbolic host, port, or user names.

 

 

--numeric-hosts

Shows numerical host addresses but does not affect the

 

resolution of port or user names.

 

 

Соседние файлы в предмете Операционные системы