Managing the Graphical Environment
The following is a partial list of the files, terms, and utilities used:
• /etc/X11/xorg.conf
X Configuration File. If you’re using X.org on a Linux distribution
that uses the init daemon, your configuration settings are saved in
/etc/X11/xorg.conf. If you’re using XFree86, your configuration
settings are saved in /etc/X11/XF86Config.
• xhost
You can also tunnel your X server traffic to remote X clients using an
SSH connection. To do this, you must configure the client system to
accept connections from the X server using the
xhost +X_server_hostname
command.
• DISPLAY
Then you configure the X server to redirect its graphical display to
the client system by setting the DISPLAY environment variable. The
syntax is
DISPLAY=X_ client_hostname:0.0.
• xwininfo
The xwininfo command can be used to display information about open
windows on your graphical desktop. You can run the command and then
click the window you want to get information about.
• xdpyinfo
The xdpyinfo command can be used to display the capabilities of a
server, the various parameters used when communicating between clients
and the server, and the different screen modes available.
• X
If you’re in runlevel 3 and want to start the Linux GUI, simply enter
startx (which is a simple shell script wrapper for xinit) or just X at
the shell prompt.
LX0-104 Exam Objectives (H)
Showing posts with label x server. Show all posts
Showing posts with label x server. Show all posts
Thursday, December 8, 2016
Tunnel Your X server traffic
Tunnel Your X server traffic
You can also tunnel your X server traffic to remote X clients using an
SSH connection. This is important because unencrypted X traffic
provides an attacker with a gold mine of information that he or she
can use to compromise your systems.
To configure a remote X client without encryption, you can use the
following procedure:
1) On the remote
X client, enter xhost +X_server_hostname.
This tells the client to accept connections from the X server.
2) On the X server, enter
DISPLAY=X_client_hostname:0.0
and then enter
export DISPLAY
This tells the X server to display its output on the remote X client.
3) From the X client, use the ssh client to access the shell prompt on
the X server and then run the graphical application you want displayed
on the X client. For example, you could enter gedit at the shell
prompt to remotely display the gedit text editor. You could also enter
office at the shell prompt to remotely display the OpenOffice.org suite.
This procedure works, but all the X traffic is transmitted unencrypted. This isn’t good.
Instead, you should use SSH to tunnel the X server traffic between the X server and the X client.
You can do this using one of the following options:
• Use the –X option with the ssh client program.
• Set the ForwardX11 option to a value of yes in the
/etc/ssh/ssh_config file on the X client system.
Once this is done, you then need to set the X11Forwarding option to
yes in the /etc/ssh/ sshd_config file on the X server system.
LX0-104 Exam Objectives (H)
You can also tunnel your X server traffic to remote X clients using an
SSH connection. This is important because unencrypted X traffic
provides an attacker with a gold mine of information that he or she
can use to compromise your systems.
To configure a remote X client without encryption, you can use the
following procedure:
1) On the remote
X client, enter xhost +X_server_hostname.
This tells the client to accept connections from the X server.
2) On the X server, enter
DISPLAY=X_client_hostname:0.0
and then enter
export DISPLAY
This tells the X server to display its output on the remote X client.
3) From the X client, use the ssh client to access the shell prompt on
the X server and then run the graphical application you want displayed
on the X client. For example, you could enter gedit at the shell
prompt to remotely display the gedit text editor. You could also enter
office at the shell prompt to remotely display the OpenOffice.org suite.
This procedure works, but all the X traffic is transmitted unencrypted. This isn’t good.
Instead, you should use SSH to tunnel the X server traffic between the X server and the X client.
You can do this using one of the following options:
• Use the –X option with the ssh client program.
• Set the ForwardX11 option to a value of yes in the
/etc/ssh/ssh_config file on the X client system.
Once this is done, you then need to set the X11Forwarding option to
yes in the /etc/ssh/ sshd_config file on the X server system.
LX0-104 Exam Objectives (H)
Commonly used sections in a typical xorg.conf file VIII
Commonly used sections in a typical xorg.conf file VIII
The last section we’re going to look at here is the ServerLayout
section. This is a key section.
It “glues” all the preceding sections together into a complete
configuration. The ServerLayout section uses the following syntax:
Section "ServerLayout"
Identifier "name"
Screen "screen_id"
InputDevice "input_dev_id"
options
...
EndSection
The ServerLayout section binds together one or more Screen section(s)
and one or more InputDevice section(s), as shown in the following example:
Section "ServerLayout"
Identifier "Layout[all]"
Option "Clone" "off"
Option "Xinerama" "off"
Screen "Screen[0]"
InputDevice "VMware Keyboard" "CoreKeyboard"
InputDevice "VMware Mouse" "CorePointer"
EndSection
You can use the following directives within the ServerLayout section:
• Identifier "name"
Defines a unique name for the server layout.
• Screen "screen_id"
Specifies which screen parameters to use for the server layout.
• InputDevice "input_device_id"
Specifies which input devices are to be used for theserver layout.
You need one directive for each input device (usuallyone for the mouse
and one for the keyboard).
• Option "option_name"
Any option that can be used in the ServerFlags section can
also be specified here. If the same option is specified in both
places, the option specified in the ServerLayout section overrides the
option listed in the ServerFlags section.
LX0-104 Exam Objectives (H)
The last section we’re going to look at here is the ServerLayout
section. This is a key section.
It “glues” all the preceding sections together into a complete
configuration. The ServerLayout section uses the following syntax:
Section "ServerLayout"
Identifier "name"
Screen "screen_id"
InputDevice "input_dev_id"
options
...
EndSection
The ServerLayout section binds together one or more Screen section(s)
and one or more InputDevice section(s), as shown in the following example:
Section "ServerLayout"
Identifier "Layout[all]"
Option "Clone" "off"
Option "Xinerama" "off"
Screen "Screen[0]"
InputDevice "VMware Keyboard" "CoreKeyboard"
InputDevice "VMware Mouse" "CorePointer"
EndSection
You can use the following directives within the ServerLayout section:
• Identifier "name"
Defines a unique name for the server layout.
• Screen "screen_id"
Specifies which screen parameters to use for the server layout.
• InputDevice "input_device_id"
Specifies which input devices are to be used for theserver layout.
You need one directive for each input device (usuallyone for the mouse
and one for the keyboard).
• Option "option_name"
Any option that can be used in the ServerFlags section can
also be specified here. If the same option is specified in both
places, the option specified in the ServerLayout section overrides the
option listed in the ServerFlags section.
LX0-104 Exam Objectives (H)
Commonly used sections in a typical xorg.conf file VI
Commonly used sections in a typical xorg.conf file VI
The next section is the Screen section, which binds your video board
to your monitor. Here is an example:
Section "Screen"
Identifier "Screen[0]"
Device "VMware SVGA"
Monitor "vmware"
# Don't specify DefaultColorDepth unless you know what you're
# doing. It will override the driver's preferences which can
# cause the X server not to run if the host doesn't support the
# depth.
Subsection "Display"
# VGA mode: better left untouched
Depth 4
Modes "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 8
Modes "1024x768"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 15
Modes "1024x768"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 16
Modes "1024x768"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 24
Modes "1024x768"
ViewPort 0 0
EndSubsection
EndSection
The video board is specified by the Device directive, whereas your
monitor is specified by the Monitor directive. The
device-id
used in the Device directive in the Screen section must match
the Identifier directive within the Device section of the file (which
will be discussed next).
The syntax is as follows:
Section "Screen"
Identifier "name"
Device "device_id"
Monitor "monitor_id"
SubSection "Display"
...
EndSubSection
...
EndSection
As you can see in the preceding examples, each Screen section can have
multiple Display subsections. You can use the following directives within each
Display subsection:
• Depth depth
Specifies the color depth as the number of bits per pixel. Most video
drivers support color depths of 8, 15, 16, and 24.
• Modes mode_name
Specifies the list of video modes to use (contained in quotes). Each
mode must match the appropriate entry in the Monitor section.
• ViewPort x y
Sets the upper-left corner of the display.
The next section you need to be familiar with is the Device section.
There must be one Device section for each video adapter installed in your system.
Here is a sample Device section:
Section "Device"
Identifier "VMware SVGA"
Driver "vmware"
EndSection
The Identifier directive defines a unique name for the video adapter.The Driver
directive specifies which driver should be used for this video adapter.
LX0-104 Exam Objectives (H)
The next section is the Screen section, which binds your video board
to your monitor. Here is an example:
Section "Screen"
Identifier "Screen[0]"
Device "VMware SVGA"
Monitor "vmware"
# Don't specify DefaultColorDepth unless you know what you're
# doing. It will override the driver's preferences which can
# cause the X server not to run if the host doesn't support the
# depth.
Subsection "Display"
# VGA mode: better left untouched
Depth 4
Modes "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 8
Modes "1024x768"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 15
Modes "1024x768"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 16
Modes "1024x768"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 24
Modes "1024x768"
ViewPort 0 0
EndSubsection
EndSection
The video board is specified by the Device directive, whereas your
monitor is specified by the Monitor directive. The
device-id
used in the Device directive in the Screen section must match
the Identifier directive within the Device section of the file (which
will be discussed next).
The syntax is as follows:
Section "Screen"
Identifier "name"
Device "device_id"
Monitor "monitor_id"
SubSection "Display"
...
EndSubSection
...
EndSection
As you can see in the preceding examples, each Screen section can have
multiple Display subsections. You can use the following directives within each
Display subsection:
• Depth depth
Specifies the color depth as the number of bits per pixel. Most video
drivers support color depths of 8, 15, 16, and 24.
• Modes mode_name
Specifies the list of video modes to use (contained in quotes). Each
mode must match the appropriate entry in the Monitor section.
• ViewPort x y
Sets the upper-left corner of the display.
The next section you need to be familiar with is the Device section.
There must be one Device section for each video adapter installed in your system.
Here is a sample Device section:
Section "Device"
Identifier "VMware SVGA"
Driver "vmware"
EndSection
The Identifier directive defines a unique name for the video adapter.The Driver
directive specifies which driver should be used for this video adapter.
LX0-104 Exam Objectives (H)
Commonly used sections in a typical xorg.conf file V
Commonly used sections in a typical xorg.conf file V
The next section is the Modes section. The configuration file may have
one or more of these sections. They define video modes the X server may use.
Here is a sample:
Section "Modes"
Identifier "Modes[0]"
Modeline "1024x768" 65.0 1024 1048 1184 1344 768 771 777 806
-hsync –vsync
Modeline "1024x768" 61.89 1024 1080 1184 1344 768 769 772 794
EndSection
The syntax for the Modes section is as follows:
Section "Modes"
Identifier "name"
Modeline parameters
EndSection
The Modeline directive is used to define video modes for the monitor.
It is composed of four components:
• Pixel clock
This first component specifies the pixel clock rate in MHz. In the first
Modeline in the preceding example, this is 65.0.
• Horizontal timing
This second component is a list of four numbers that specify the
horizontal timing: hdisp, hsyncstart, hsyncend, and htotal. In the
first Modeline in the example, these values are 1024, 1048, 1184,
and 1344, respectively.
• Vertical timing
The third component is a list of four numbers that specify the vertical
timing: vdisp, vsyncstart, vsyncend, and vtotal. In the first Modeline
in the example, these values are 768, 771, 777, and 806, respectively.
• Flags
The fourth component is a list of flags that configure the video mode.
In the first Modeline in the example, the –hsync and –vsync flags are listed.
These are used to set the polarity of the hsync and vsync signals.
LX0-104 Exam Objectives (H)
The next section is the Modes section. The configuration file may have
one or more of these sections. They define video modes the X server may use.
Here is a sample:
Section "Modes"
Identifier "Modes[0]"
Modeline "1024x768" 65.0 1024 1048 1184 1344 768 771 777 806
-hsync –vsync
Modeline "1024x768" 61.89 1024 1080 1184 1344 768 769 772 794
EndSection
The syntax for the Modes section is as follows:
Section "Modes"
Identifier "name"
Modeline parameters
EndSection
The Modeline directive is used to define video modes for the monitor.
It is composed of four components:
• Pixel clock
This first component specifies the pixel clock rate in MHz. In the first
Modeline in the preceding example, this is 65.0.
• Horizontal timing
This second component is a list of four numbers that specify the
horizontal timing: hdisp, hsyncstart, hsyncend, and htotal. In the
first Modeline in the example, these values are 1024, 1048, 1184,
and 1344, respectively.
• Vertical timing
The third component is a list of four numbers that specify the vertical
timing: vdisp, vsyncstart, vsyncend, and vtotal. In the first Modeline
in the example, these values are 768, 771, 777, and 806, respectively.
• Flags
The fourth component is a list of flags that configure the video mode.
In the first Modeline in the example, the –hsync and –vsync flags are listed.
These are used to set the polarity of the hsync and vsync signals.
LX0-104 Exam Objectives (H)
Commonly used sections in a typical xorg.conf file IV
Commonly used sections in a typical xorg.conf file IV
Next is the InputDevice section. This section configures the X server
with the input devices it should use. You can use multiple InputDevice
sections, one for each input device. For example, you will usually see
an InputDevice section for the keyboard and another one for your mouse.
Examples follow:
Section "InputDevice"
Driver "kbd"
Identifier "VMware Keyboard"
Option "Protocol" "Standard"
Option "XkbLayout" "us"
Option "XkbModel" "pc104"
Option "XkbRules" "xfree86"
EndSection
Section "InputDevice"
Driver "vmmouse"
Identifier "VMware Mouse"
Option "Buttons" "5"
Option "Device" "/dev/input/mice"
Option "Name" "ImPS/2 Generic Wheel Mouse"
Option "Protocol" "IMPS/2"
Option "Vendor" "Sysp"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection
As you can see in the preceding examples, the syntax used in an
InputDevice section is as follows:
Section "InputDevice"
Identifier "name"
Driver "driver_name"
Option "options"
EndSection
LX0-104 Exam Objectives (H)
Next is the InputDevice section. This section configures the X server
with the input devices it should use. You can use multiple InputDevice
sections, one for each input device. For example, you will usually see
an InputDevice section for the keyboard and another one for your mouse.
Examples follow:
Section "InputDevice"
Driver "kbd"
Identifier "VMware Keyboard"
Option "Protocol" "Standard"
Option "XkbLayout" "us"
Option "XkbModel" "pc104"
Option "XkbRules" "xfree86"
EndSection
Section "InputDevice"
Driver "vmmouse"
Identifier "VMware Mouse"
Option "Buttons" "5"
Option "Device" "/dev/input/mice"
Option "Name" "ImPS/2 Generic Wheel Mouse"
Option "Protocol" "IMPS/2"
Option "Vendor" "Sysp"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection
As you can see in the preceding examples, the syntax used in an
InputDevice section is as follows:
Section "InputDevice"
Identifier "name"
Driver "driver_name"
Option "options"
EndSection
LX0-104 Exam Objectives (H)
Commonly used sections in a typical xorg.conf file III
Commonly used sections in a typical xorg.conf file III
Next is the Module section. This section tells the X server to load certain server extension
and font rasterizer modules at startup. Here is an example:
Section "Module"
Load "dbe"
Load "type1"
Load "freetype"
Load "extmod"
Load "glx"
Load "v4l"
EndSection
The Load modulename directive tells the X server to load the specified module. Notice
that the module name, not the module filename, is specified.
LX0-104 Exam Objectives (H)
Next is the Module section. This section tells the X server to load certain server extension
and font rasterizer modules at startup. Here is an example:
Section "Module"
Load "dbe"
Load "type1"
Load "freetype"
Load "extmod"
Load "glx"
Load "v4l"
EndSection
The Load modulename directive tells the X server to load the specified module. Notice
that the module name, not the module filename, is specified.
LX0-104 Exam Objectives (H)
Commonly used sections in a typical xorg.conf file II
Commonly used sections in a typical xorg.conf file II
Next is the ServerFlags section. This section specifies global X server options. This section is
optional, and any options specified in it may be overridden by corresponding options with the same name listed in the ServerLayout section.
Here is an example of a ServerFlags section in an xorg.conf file:
Section "ServerFlags"
Option "AllowMouseOpenFail" "on"
EndSection
In this example, the AllowMouseOpenFail option is set to a value of on. This allows the X server
to start up even if a mouse isn’t connected or can’t be initialized.
LX0-104 Exam Objectives (H)
Next is the ServerFlags section. This section specifies global X server options. This section is
optional, and any options specified in it may be overridden by corresponding options with the same name listed in the ServerLayout section.
Here is an example of a ServerFlags section in an xorg.conf file:
Section "ServerFlags"
Option "AllowMouseOpenFail" "on"
EndSection
In this example, the AllowMouseOpenFail option is set to a value of on. This allows the X server
to start up even if a mouse isn’t connected or can’t be initialized.
LX0-104 Exam Objectives (H)
Commonly used sections in a typical xorg.conf file I
Commonly used sections in a typical xorg.conf file I
First is the Files section. This section tells the X server where to find the files it
needs to do its job, such as font files and input device files. Here is an
abbreviated example of a Files section:
Section "Files"
FontPath "/usr/X11R6/lib/X11/fonts/misc:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/local
FontPath "/usr/X11R6/lib/X11/fonts/75dpi:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi:unscaled"
...
FontPath "/usr/X11R6/lib/X11/fonts/xtest"
FontPath "/opt/kde3/share/fonts"
InputDevices "/dev/gpmdata"
InputDevices "/dev/input/mice"
EndSection
LX0-104 Exam Objectives (H)
First is the Files section. This section tells the X server where to find the files it
needs to do its job, such as font files and input device files. Here is an
abbreviated example of a Files section:
Section "Files"
FontPath "/usr/X11R6/lib/X11/fonts/misc:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/local
FontPath "/usr/X11R6/lib/X11/fonts/75dpi:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi:unscaled"
...
FontPath "/usr/X11R6/lib/X11/fonts/xtest"
FontPath "/opt/kde3/share/fonts"
InputDevices "/dev/gpmdata"
InputDevices "/dev/input/mice"
EndSection
LX0-104 Exam Objectives (H)
Subscribe to:
Posts (Atom)