SlideShare a Scribd company logo
1 of 76
Download to read offline
Hendrik Brückner, Linux on System z Kernel Development, brueckner@de.ibm.com



             Introduction to the Linux on System z
                 Terminal Server using z/VM IUCV
                       Discover how terminal connections over z/VM IUCV let you comfortably manage
                                                          your Linux instances even in emergencies.

Linux on System z Live Virtual Class
Wednesday, November 17. 2010




1                                                                                         © 2009 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

Trademarks
    The following are trademarks of the International Business Machines Corporation in the United States, other countries, or both.

     Not all common law marks used by IBM are listed on this page. Failure of a mark to appear does not mean that IBM does not use the mark nor does it mean that the product is not
     actively marketed or is not significant within its relevant market.
     Those trademarks followed by ® are registered trademarks of IBM in the United States; all others are trademarks or common law marks of IBM in the United States.



       For a complete list of IBM Trademarks, see www.ibm.com/legal/copytrade.shtml:

       *, AS/400®, e business(logo)®, DBE, ESCO, eServer, FICON, IBM®, IBM (logo)®, iSeries®, MVS, OS/390®, pSeries®, RS/6000®, S/30, VM/ESA®, VSE/ESA,
       WebSphere®, xSeries®, z/OS®, zSeries®, z/VM®, System i, System i5, System p, System p5, System x, System z, System z9®, BladeCenter®



The following are trademarks or registered trademarks of other companies.

      Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries.
      Cell Broadband Engine is a trademark of Sony Computer Entertainment, Inc. in the United States, other countries, or both and is used under license therefrom.
      Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
      Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both.
      Intel, Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino logo, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel
      Corporation or its subsidiaries in the United States and other countries.
      UNIX is a registered trademark of The Open Group in the United States and other countries.
      Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
      ITIL is a registered trademark, and a registered community trademark of the Office of Government Commerce, and is registered in the U.S. Patent and Trademark Office.
      IT Infrastructure Library is a registered trademark of the Central Computer and Telecommunications Agency, which is now part of the Office of Government Commerce.

* All other products may be trademarks or registered trademarks of their respective companies.

    Notes:
    Performance is in Internal Throughput Rate (ITR) ratio based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput that any user will
    experience will vary depending upon considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore,
    no assurance can be given that an individual user will achieve throughput improvements equivalent to the performance ratios stated here.
    IBM hardware products are manufactured from new parts, or new and serviceable used parts. Regardless, our warranty terms apply.
    All customer examples cited or described in this presentation are presented as illustrations of the manner in which some customers have used IBM products and the results they may have achieved. Actual
    environmental costs and performance characteristics will vary depending on individual customer configurations and conditions.
    This publication was produced in the United States. IBM may not offer the products, services or features discussed in this document in other countries, and the information may be subject to change without
    notice. Consult your local IBM business contact for information on the product or services available in your area.
    All statements regarding IBM's future direction and intent are subject to change or withdrawal without notice, and represent goals and objectives only.
    Information about non-IBM products is obtained from the manufacturers of those products or their published announcements. IBM has not tested those products and cannot confirm the performance,
    compatibility, or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products.
    Prices subject to change without notice. Contact your IBM representative or Business Partner for the most current pricing in your geography.



2                                                                                                                                                                                               © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What's on the agenda?



■   How can the terminal server using IUCV help you?

■   What does an IUCV terminal environment look like?
     – How can you establish terminal sessions?
     – How can you set up your IUCV terminal environment?




3                                                                      © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

Why do you need a terminal server using z/VM IUCV?



■   Ask yourself
     – Are you sick and tired of reconfiguring your Linux instances using a line-mode terminal?
     – How often have you struggled using “ed” to correct configuration files?
          • For example, replacing the IP address in the network configuration

     – Why not using vi or emacs?




4                                                                                    © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How can the terminal server using IUCV help you?



■   Full-screen terminal access to Linux instances on the same z/VM
■   Access to Linux instances that are not connected to an Internet Protocol (IP) network
■   Use cases
     – Provide an alternative terminal access to 3270 and 3215 line-mode terminals
     – Increase availability by providing emergency access if the network for a system fails
     – Centralize access to systems by providing a terminal server environment
     – Heighten security by separating user networks from administrator networks or by
       isolating sensitive Linux instances from public IP networks




5                                                                                    © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What are terminals and what is z/VM IUCV?



■   Linux terminals and consoles
     – Input/output devices through which users interact with Linux and Linux applications
     – Terminals differ in their modes and capabilities
     – Consoles are output devices which display Linux kernel messages
          • The preferred console displays messages during the boot process

■   Inter-user communication vehicle (IUCV)
     – A z/VM CP interface for passing data between virtual machines or between CP and a
       virtual machine
     – The Linux kernel includes IUCV
          • AF_IUCV – Addressing family for network sockets
          • IUCV hypervisor console (HVC) terminal device driver


6                                                                                   © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What does an IUCV terminal environment look like?
Overview and terminology




                                          Terminal Server                      Target Systems



      User's               SSH
    Workstation
                                                 Linux                 Linux   Linux    Linux      Linux




                                                            IUCV
                                                                                            z/VM system

7                                                                                               © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

Which programs do you use in an IUCV terminal environment?



■   IUCV terminal programs (s390-tools)
     – iucvconn – Start terminal connection over IUCV
     – iucvtty – Allow remote logins over IUCV
     – ts-shell – Login shell for setting up a terminal server using IUCV
     – chiucvallow – Restrict access to IUCV HVC terminal devices

■   Terminal access over IUCV is provided by
     – iucvtty instances
     – IUCV hypervisor console (HVC) device driver (Linux kernel)




8                                                                           © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What does an IUCV terminal environment look like?




9                                                                      © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How can you enable a terminal server for iucvconn?



■    Authorizing the z/VM guest virtual machine for IUCV
      – Adding an IUCV user directory statement, for example, IUCV ANY
      – The z/VM user directory for a terminal server might look like:

        USER LNXTS     XSECRETX 768M 1G G
        * General statements
            IPL 0150
            MACH ESA 8
        * IUCV authorization
            IUCV ANY
            OPTION MAXCONN 128
        * Generic device statements
            CONSOLE 0009 3215 T
            SPOOL 000C 2540 READER *
        *   ...




10                                                                       © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How can you establish IUCV terminal sessions?
Establishing terminal sessions to iucvtty instances


■    iucvconn establishes terminal sessions
      – Socket communication is based on the AF_IUCV address family
      – Addressing is based on the z/VM user ID and a terminal identifier (“term1”)
■    iucvtty waits for incoming connections and starts /bin/login to log on users




11                                                                                    © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How can you set up iucvtty instances on target systems?



1.Choosing a terminal identifier
     – For example: term1
2.Enabling user logins
     – Start the iucvtty program through /etc/inittab

       i1:2345:respawn:/usr/bin/iucvtty term1




12                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How do you use iucvconn?
Establishing terminal connections with iucvconn to iucvtty instances



     brueckh@cetus:~$ ssh brueckner@lnxts
     Password:
     brueckner@lnxts:~$ iucvconn LINUX005 term1
     login: brueckner
     Password:
     [brueckner@linux005 ~]$ ls
     [brueckner@linux005 ~]$ ps
       PID TTY          TIME CMD
      1731 pts/0    00:00:00 bash
      1762 pts/0    00:00:00 ps
     [brueckner@linux005 ~]$




13                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How can you establish IUCV terminal sessions?
Establishing terminal sessions to HVC terminal devices


■    IUCV HVC device driver provides up to 8 terminal devices (/dev/hvc0 .. /dev/hvc7)
      – Using the terminal identifiers “lnxhvc0” through “lnxhvc7”




14                                                                               © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How can you set up HVC terminal devices on target systems?



1.Specifying the number of IUCV HVC terminal devices
     – Set kernel parameter: hvc_iucv=2
2.Enabling user logins
     – Start a getty program on each terminal through /etc/inittab

       h0:2345:respawn:/sbin/mingetty hvc0
       h1:2345:respawn:/sbin/agetty -L 9600 hvc1 xterm


3.Permitting root logins
     – List HVC terminal devices in /etc/securetty
4.Activating hvc0 to receive Linux kernel messages
     – Set kernel parameter: console=hvc0 console=ttyS0



15                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How do you use iucvconn?
Establishing terminal connections with iucvconn to HVC terminal devices



     brueckh@cetus:~$ ssh brueckner@lnxts
     Password:
     brueckner@lnxts:~$ iucvconn LINUX005 lnxhvc0

     Red Hat Enterprise Linux Server release 5.4 (Tikanga)
     Kernel 2.6.18-164.el5 on an s390x

     linux005 login: root
     Password:
     Last login: Fri Mar 5 14:31:23 on hvc0
     [root@linux005 ~]# ps
       PID TTY          TIME CMD
      4305 hvc0     00:00:00 bash
      4480 hvc0     00:00:00 ps
     [root@linux005 ~]# logout




16                                                                        © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What are the differences between iucvtty and IUCV HVC?



     Criteria                                              iucvtty       IUCV HVC device driver
     Origin                                               s390-tools          Linux kernel
     Number of terminal instances                              >8                 <= 8
     Terminal identifiers                                   variable             fixed
     Direct root login                                                           
     Receiving kernel messages                                                   
     Acting as preferred console                                                 
     Restricting access to terminals                                             
                                                        administrative         emergency
     Typical use case
                                                           actions              actions




17                                                                                         © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What else can you do with iucvconn?



■    Accessing special functions through escape characters
      – Use Ctrl+_ followed by “d” to disconnect terminal sessions

■    Creating transcripts of terminal sessions with target systems
      – Writing the terminal data stream to a log file (transcript)
      – Replaying transcripts with realistic output delays


                    brueckh@cetus:~$ ssh brueckner@lnxts
                    Password:
                    brueckner@lnxts:~$ iucvconn -s ~/transcripts/linux005 LINUX005 lnxhvc0
                    [...]

                    brueckner@lnxts:~$ cd transcripts/
                    brueckner@lnxts:~/transcripts$ ls -lA
                    linux005 linux005.info linux005.timing

                    brueckner@lnxts:~/transcripts$ scriptreplay linux005.timing linux005


18                                                                                 © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What can you do with the terminal server shell, called ts-shell?



■    ts-shell helps you to
      – Set up a terminal server to simplify system administration by providing a central access
        point
      – Authorize users to establish IUCV terminal connections to specific target systems
      – Improve auditing through creating transcripts of terminal sessions with target systems
      – Restrict users from getting access to the terminal server system

■    In a ts-shell session, you can
      – List your authorizations
      – Establish terminal connections




19                                                                                    © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How does ts-shell perform authorization checks?



■    Before ts-shell connects to a target system, ts-shell verifies that
      – The user is authorized for the specified target system
      – The target system is included in the global ts-shell authorization

■    ts-shell creates a transcript of a terminal session when
      – The target system is listed in the audit-systems configuration




        user                           ts-shell                             ts-shell                   ts-shell

connect TGSYS                verify user authorization             verify global authorization      start iucvconn


                               ts-authorization.conf                   ts-systems.conf           ts-audit-systems.conf
                                                                       unrestricted.conf


20                                                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How can you authorize users for ts-shell?



1.Creating a group and a user for ts-shell
       groupadd testgrp
       useradd -m -s /usr/bin/ts-shell -g ts-shell -G testgrp bob


2.Granting authorization to ts-shell users
     – Edit /etc/iucvterm/ts-authorization.conf

       @testgrp = list:linux006,linux007,linux008
       bob = list:linux005




21                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How do you use ts-shell?
Displaying authorizations and establishing terminal connections with ts-shell


brueckh@cetus:~$ ssh bob@lnxts
Password:
Last login: Fri Mar 5 12:01:32 2010 from dyn-9-152-212-21
Welcome to the Terminal Server shell.
Type 'help' to get a list of available commands.


bob@ts-shell> list
linux006
linux007                       bob@ts-shell> connect linux005
linux008                       ts-shell: Connecting to linux005 (terminal identifier: lnxhvc0)...
linux005
bob@ts-shell>                  Red Hat Enterprise Linux Server release 5.4 (Tikanga)
                               Kernel 2.6.18-164.el5 on an s390x

                               linux005 login: root
                               Password:
                               Last login: Fri Mar 5 12:02:45 on hvc0
                               [root@linux005 ~]# ps
                                 PID TTY          TIME CMD
                                1678 hvc0     00:00:00 bash
                                1708 hvc0     00:00:00 ps
                               [root@linux005 ~]# logout
                               ts-shell: Connection ended


22                                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How can you secure an IUCV terminal environment?




23                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

Conclusion



■    The terminal server using IUCV helps you to
      – Simplify system administration by providing a central access point
      – Heighten availability by providing emergency access to Linux instances
      – Work more comfortably by using full-screen terminals as alternative to traditional
        mainframe terminals




24                                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

Which Linux distributions include the terminal server using IUCV?



■    Red Hat
      – Red Hat Enterprise Linux 5 Update 4 or higher
      – Red Hat Enterprise Linux 6

■    Novell
      – Novell SUSE Linux Enterprise Server 10 Service Pack 3 or higher
      – Novell SUSE Linux Enterprise Server 11 Service Pack 1 or higher

■    “Upstream” availability
      – Linux kernel 2.6.30 or higher
      – s390-tools 1.8.1 or higher




25                                                                        © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

Where do you get more information?



■    developerWorks
      – How to Set up a Terminal Server Environment (SC34-2596)
      – Device Drivers, Features, and Commands (SC33-8411)

■    s390-tools package
      – Man pages for iucvconn(1), iucvtty(1), ts-shell(1), af_iucv(7), and hvc_iucv(9)
      – ts-shell README




26                                                                                        © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV




                                               Thank you!
                                       Any Questions?


                                                   Hendrik Brückner                IBM Deutschland Research
                                                                                   & Development GmbH
                                                   Linux on System z Development   Schönaicher Strasse 220
                                                                                   71032 Böblingen, Germany

                                                                                   Phone +49 7031 16-1073
                                                                                   brueckner@de.ibm.com




27                                                                                                          © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

Backup




28                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV




                                            THANK YOU!


                                       Your Linux on System z
                                          Requirements?
                 Are you missing a certain feature, functionality, or tool?
                              We'd love to hear from you!

                          We will evaluate each request and (hopefully)
                          develop the additional functionality you need.

                                               Send your input to
                                            brueckner@de.ibm.com


29                                                                            © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What is iucvconn_on_login?



■    iucvconn_on_login is an alternative login shell for setting up a terminal server
      – Log in to Linux with a user ID that matches the z/VM user ID of the target system
      – After a successful login, a terminal session is established and the user is prompted to log
        in to the target system
■    Creating a user for iucvconn_on_login
      – useradd -m -s /usr/bin/iucvconn_on_login lxguest1




30                                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What can you do if your terminal setup does not work?



■    What if there is no login prompt when you have connected to a HVC terminal?
      – Simply press the Return key to reactivate the getty program.

■    What if getty processes respawn too fast on HVC terminal devices?
     What if getty processes fail to open HVC terminal devices?
      – Check the setting of the hvc_iucv kernel parameter in your boot configuration.
      – Run zipl to write the modified boot configuration and reboot.
      – Check /etc/inittab or upstart job files to configure only activated HVC terminal
        devices. Alternatively, use ttyrun to prevent a respawn loop if a terminal is not
        operational.

■    What if the root user cannot log in on a HVC terminal device?
      – Check if the HVC terminal device is listed in the /etc/securetty file?



31                                                                                  © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How can you restrict access to HVC terminal devices?
Authorizing HVC terminal connections with a z/VM user ID filter


■    The IUCV HVC device driver can accept IUCV connections only from specific terminal
     servers
      – Use the hvc_iucv_allow= kernel parameter to specify a comma-separated list of
        authorized z/VM user IDs

■    The chiucvallow command maintains the hvc_iucv_allow setting (filter) at runtime
      – Display the current z/VM user ID filter with lsiucvallow or chiucvallow -l
      – Clear the z/VM user ID filter with chiucvallow -c
      – Modify the current z/VM user ID filter with chiucvallow -e
      – Verify a z/VM user ID filter, which is saved in a file, with chiucvallow -V
          • You can also verify ts-shell authorization files that list z/VM user IDs




32                                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How do you use the IUCV terminal programs?



■    Using the iucvconn program
       – To access the first z/VM IUCV HVC terminal on the Linux instance in z/VM guest LNXSYS02
           $ iucvconn LNXSYS02 lnxhvc0

       – To create a transcript of the terminal session to the Linux instance in z/VM guest LNXSYS99
           $ iucvconn -s ~/transcripts/lnxsys99 LNXSYS99 lnxhvc0
■    Using the iucvtty program
       – To allow remote logins using the terminal identifier “lnxterm”
           # iucvtty lnxterm

       – To access the “lnxterm” terminal on the Linux instance in z/VM guest LNXSYS01
           $ iucvconn LNXSYS01 lnxterm

       – To use /sbin/sulogin instead of /bin/login for terminal identifier “suterm”
           # iucvtty suterm -- /sbin/sulogin



33                                                                                               © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How do you configure Linux instances to provide IUCV terminals?
Examples using inittab


■    Creating new inittab entries for iucvtty instances
      t1:2345:respawn:/usr/bin/iucvtty lnxterm

■    Creating new inittab entries for IUCV HVC terminal devices
      – Using the traditional approach:

        h0:2345:respawn:/sbin/agetty -L 9600 hvc0 xterm
      – Using the ttyrun program:

        h1:2345:respawn:/sbin/ttyrun hvc1 /sbin/agetty -L 9600 %t xterm




34                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How do you configure Linux instances to provide IUCV terminals?
Examples using upstart job files


■    Creating a job file for iucvtty
             start on runlevel [12345]
             stop on runlevel [06]

             respawn
             exec /usr/bin/iucvtty lnxterm
             console none
■    Creating a job file for a HVC terminal device
             start on runlevel [12345]
             stop on runlevel [06]

             respawn
             normal exit 42
             exec /sbin/ttyrun -e 42 hvc0 /sbin/mingetty %t




35                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

Which Linux kernel components are involved?




                             Other                            IUCV
                                                                                       AF_IUCV
                           back-ends                        back-end



                        Hypervisor Console (HVC)                        IUCV base
                           TTY device driver                           device driver

                                TTY core layer
                                                                                            Network core
Kernel space
User space             /dev/hvc0                   /dev/hvc1                                     socket()


36                                                                                                    © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What does an IUCV terminal environment look like?
Putting it all together




37                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What are Linux terminals and consoles?



■    Linux terminals
      – Input/output devices through which users interact with Linux and Linux applications
      – Terminals differ in their modes and capabilities
■    Linux consoles
      – Consoles are output devices which display Linux kernel messages
      – The preferred console
          • The preferred console is the device that displays messages during the boot process
            when the 'init' program is called
■    Linux terminal device drivers typically combine terminal and console devices




38                                                                                   © 2010 IBM Corporation
Hendrik Brückner, Linux on System z Kernel Development, brueckner@de.ibm.com



             Introduction to the Linux on System z
                 Terminal Server using z/VM IUCV
                       Discover how terminal connections over z/VM IUCV let you comfortably manage
                                                          your Linux instances even in emergencies.

Linux on System z Live Virtual Class
Wednesday, November 17. 2010




                                                                                                                   1




1                                                                                         © 2009 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

Trademarks
    The following are trademarks of the International Business Machines Corporation in the United States, other countries, or both.

     Not all common law marks used by IBM are listed on this page. Failure of a mark to appear does not mean that IBM does not use the mark nor does it mean that the product is not
     actively marketed or is not significant within its relevant market.
     Those trademarks followed by ® are registered trademarks of IBM in the United States; all others are trademarks or common law marks of IBM in the United States.



       For a complete list of IBM Trademarks, see www.ibm.com/legal/copytrade.shtml:

       *, AS/400®, e business(logo)®, DBE, ESCO, eServer, FICON, IBM®, IBM (logo)®, iSeries®, MVS, OS/390®, pSeries®, RS/6000®, S/30, VM/ESA®, VSE/ESA,
       WebSphere®, xSeries®, z/OS®, zSeries®, z/VM®, System i, System i5, System p, System p5, System x, System z, System z9®, BladeCenter®




The following are trademarks or registered trademarks of other companies.

      Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries.
      Cell Broadband Engine is a trademark of Sony Computer Entertainment, Inc. in the United States, other countries, or both and is used under license therefrom.
      Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
      Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both.
      Intel, Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino logo, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel
      Corporation or its subsidiaries in the United States and other countries.
      UNIX is a registered trademark of The Open Group in the United States and other countries.
      Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
      ITIL is a registered trademark, and a registered community trademark of the Office of Government Commerce, and is registered in the U.S. Patent and Trademark Office.
      IT Infrastructure Library is a registered trademark of the Central Computer and Telecommunications Agency, which is now part of the Office of Government Commerce.

* All other products may be trademarks or registered trademarks of their respective companies.

    Notes:
    Performance is in Internal Throughput Rate (ITR) ratio based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput that any user will
    experience will vary depending upon considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore,
    no assurance can be given that an individual user will achieve throughput improvements equivalent to the performance ratios stated here.
    IBM hardware products are manufactured from new parts, or new and serviceable used parts. Regardless, our warranty terms apply.
    All customer examples cited or described in this presentation are presented as illustrations of the manner in which some customers have used IBM products and the results they may have achieved. Actual
    environmental costs and performance characteristics will vary depending on individual customer configurations and conditions.
    This publication was produced in the United States. IBM may not offer the products, services or features discussed in this document in other countries, and the information may be subject to change without
    notice. Consult your local IBM business contact for information on the product or services available in your area.
    All statements regarding IBM's future direction and intent are subject to change or withdrawal without notice, and represent goals and objectives only.
    Information about non-IBM products is obtained from the manufacturers of those products or their published announcements. IBM has not tested those products and cannot confirm the performance,
    compatibility, or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products.
    Prices subject to change without notice. Contact your IBM representative or Business Partner for the most current pricing in your geography.



2                                                                                                                                                                                               © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What's on the agenda?



■   How can the terminal server using IUCV help you?

■   What does an IUCV terminal environment look like?
     – How can you establish terminal sessions?
     – How can you set up your IUCV terminal environment?




3                                                                      © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

Why do you need a terminal server using z/VM IUCV?



■   Ask yourself
     – Are you sick and tired of reconfiguring your Linux instances using a line-mode terminal?
     – How often have you struggled using “ed” to correct configuration files?
          • For example, replacing the IP address in the network configuration

     – Why not using vi or emacs?




4                                                                                    © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How can the terminal server using IUCV help you?



■   Full-screen terminal access to Linux instances on the same z/VM
■   Access to Linux instances that are not connected to an Internet Protocol (IP) network
■   Use cases
     – Provide an alternative terminal access to 3270 and 3215 line-mode terminals
     – Increase availability by providing emergency access if the network for a system fails
     – Centralize access to systems by providing a terminal server environment
     – Heighten security by separating user networks from administrator networks or by
       isolating sensitive Linux instances from public IP networks




5                                                                                    © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

  What are terminals and what is z/VM IUCV?



  ■   Linux terminals and consoles
       – Input/output devices through which users interact with Linux and Linux applications
       – Terminals differ in their modes and capabilities
       – Consoles are output devices which display Linux kernel messages
            • The preferred console displays messages during the boot process

  ■   Inter-user communication vehicle (IUCV)
       – A z/VM CP interface for passing data between virtual machines or between CP and a
         virtual machine
       – The Linux kernel includes IUCV
            • AF_IUCV – Addressing family for network sockets
            • IUCV hypervisor console (HVC) terminal device driver


  6                                                                                   © 2010 IBM Corporation




Terminal modes:
   ● Line-mode terminals: 3215
   ● Block-mode terminals: 3270
   ● „Full-screen mode“ terminals: allow advanced interactive capabilities

Terminal capabilities:
   ● Specify terminal initialization sequences, screen positioning, colors, ...

Terminal emulation:
   ● Today, separate physical terminals are rarities.
   ● Programs like xterm, kconsole, etc. emulate real terminals.
   ● The TERM environment variable specifies the set of terminal
     capabilities. The terminal capabilities are stored in „terminfo“ databases.
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What does an IUCV terminal environment look like?
Overview and terminology




                                          Terminal Server                      Target Systems



      User's               SSH
    Workstation
                                                 Linux                 Linux   Linux    Linux      Linux




                                                            IUCV
                                                                                            z/VM system

7                                                                                               © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

  Which programs do you use in an IUCV terminal environment?



  ■   IUCV terminal programs (s390-tools)
        – iucvconn – Start terminal connection over IUCV
        – iucvtty – Allow remote logins over IUCV
        – ts-shell – Login shell for setting up a terminal server using IUCV
        – chiucvallow – Restrict access to IUCV HVC terminal devices

  ■   Terminal access over IUCV is provided by
        – iucvtty instances
        – IUCV hypervisor console (HVC) device driver (Linux kernel)




  8                                                                                  © 2010 IBM Corporation




General:
   ●  The Linux instances must be z/VM guest operating systems of the same z/VM
   ●  Security hints:
      ●  IUCV authorization for the z/VM guest virtual machine
      ●  z/VM user ID filter for iucvtty instances and the z/VM IUCV HVC device driver

iucvconn:
    ● Establishes IUCV connections to either iucvtty instances or HVC terminal devices
    ● Supports session logging; use „scriptreplay“ to replay transcripts

      ts-shell:
      ●   Authorizes Linux users based on user names and group memberships for accessing
          terminals
      ●   Linux users can list the authorizations and access terminals. If a user is authorized to
          access a terminal, iucvconn is started.

lsiucvallow, chiucvallow:
    ●  List, verify, and change the z/VM user ID filter of the IUCV HVC device driver. The filter
       specifies the z/VM user IDs that are authorized to access HVC terminal devices.

iucvtty:
    ●   Terminal login on pseudo-terminal devices (pts) using /bin/login
    ●   For security reason, /bin/login does not permit the root user to log in on pseudo-
        terminal devices.

z/VM IUCV hypervisor console (HVC) device driver (Linux kernel):
   ●   provides up to 8 terminals
   ●   the first terminal can be activated as (preferred) Linux console
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What does an IUCV terminal environment look like?




9                                                                      © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

  How can you enable a terminal server for iucvconn?



  ■    Authorizing the z/VM guest virtual machine for IUCV
        – Adding an IUCV user directory statement, for example, IUCV ANY
        – The z/VM user directory for a terminal server might look like:

          USER LNXTS     XSECRETX 768M 1G G
          * General statements
              IPL 0150
              MACH ESA 8
          * IUCV authorization
              IUCV ANY
              OPTION MAXCONN 128
          * Generic device statements
              CONSOLE 0009 3215 T
              SPOOL 000C 2540 READER *
          *   ...




  10                                                                       © 2010 IBM Corporation




Notes
You configure z/VM IUCV authorizations through the IUCV statement in the
z/VM user directory. Depending on your needs and security policies you can
use different strategies:
   ●   Permit any IUCV connection to a target system:
              IUCV ALLOW
   ●   Permit the terminal server to connect to specific z/VM guest virtual
       machines:
              IUCV LXGUEST1
              IUCV LXGUEST2
   ●   Permit the terminal server to connect to any z/VM guest virtual machine:
              IUCV ANY
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How can you establish IUCV terminal sessions?
Establishing terminal sessions to iucvtty instances


■    iucvconn establishes terminal sessions
      – Socket communication is based on the AF_IUCV address family
      – Addressing is based on the z/VM user ID and a terminal identifier (“term1”)
■    iucvtty waits for incoming connections and starts /bin/login to log on users




11                                                                                    © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How can you set up iucvtty instances on target systems?



1.Choosing a terminal identifier
     – For example: term1
2.Enabling user logins
     – Start the iucvtty program through /etc/inittab

       i1:2345:respawn:/usr/bin/iucvtty term1




12                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How do you use iucvconn?
Establishing terminal connections with iucvconn to iucvtty instances



Click to add an outline
 brueckh@cetus:~$ ssh brueckner@lnxts
 Password:
 brueckner@lnxts:~$ iucvconn LINUX005 term1
 login: brueckner
 Password:
 [brueckner@linux005 ~]$ ls
 [brueckner@linux005 ~]$ ps
     PID TTY              TIME CMD
   1731 pts/0         00:00:00 bash
   1762 pts/0         00:00:00 ps
 [brueckner@linux005 ~]$




13                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

  How can you establish IUCV terminal sessions?
  Establishing terminal sessions to HVC terminal devices


  ■    IUCV HVC device driver provides up to 8 terminal devices (/dev/hvc0 .. /dev/hvc7)
        – Using the terminal identifiers “lnxhvc0” through “lnxhvc7”




  14                                                                              © 2010 IBM Corporation




The z/VM IUCV HVC device driver supports the following kernel parameters:
   ●  hvc_iucv=number     Specifies the number of IUCV HVC terminals (max 8).
   ●  hvc_iucv_allow=list Specifies a list of comma-separated z/VM user IDs
                          which are authorized to access. At runtime, the filter
                          can be modified with the chiucvallow program.
Introduction to the Linux on System z Terminal Server over z/VM IUCV

  How can you set up HVC terminal devices on target systems?



  1.Specifying the number of IUCV HVC terminal devices
       – Set kernel parameter: hvc_iucv=2
  2.Enabling user logins
       – Start a getty program on each terminal through /etc/inittab

         h0:2345:respawn:/sbin/mingetty hvc0
         h1:2345:respawn:/sbin/agetty -L 9600 hvc1 xterm


  3.Permitting root logins
       – List HVC terminal devices in /etc/securetty
  4.Activating hvc0 to receive Linux kernel messages
       – Set kernel parameter: console=hvc0 console=ttyS0



  15                                                                        © 2010 IBM Corporation




Setting kernel parameters
   ●   Edit /etc/zipl.conf to add or change the kernel parameters
   ●   Run zipl to write a new boot record with the updated configuration

Activating consoles to receive Linux kernel messages
If you want terminal devices to be activated to receive Linux kernel messages, specify a
console statement for each of these other devices. The last console statement
designates the preferred console.
The default preferred console on a Linux on System z system is ttyS0. If you specify one
or more console parameters and you want to keep ttyS0 as the preferred console, add a
console parameter for ttyS0 as the last console statement.
If you specify console=hvc0 only, hvc0 becomes the preferred console. Specify
console=hvc0 console=ttyS0 to receive kernel messages on both devices but keep
ttyS0 as the preferred console.

Permitting root logins
The default login program for HVC terminal devices and iucvtty, /bin/login, restricts
root logins. Root logins are allowed only on devices that are listed in /etc/securetty.
iucvtty uses pseudo-terminal (pts) devices to communicate with the login program. For
security reasons, login programs, like /bin/login, do not permit root logins on pseudo-
terminal devices (see also the man-page for securetty(5)).
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How do you use iucvconn?
Establishing terminal connections with iucvconn to HVC terminal devices



Click to add an outline ssh brueckner@lnxts
 brueckh@cetus:~$
 Password:
 brueckner@lnxts:~$ iucvconn LINUX005 lnxhvc0

     Red Hat Enterprise Linux Server release 5.4 (Tikanga)
     Kernel 2.6.18-164.el5 on an s390x

     linux005 login: root
     Password:
     Last login: Fri Mar 5 14:31:23 on hvc0
     [root@linux005 ~]# ps
       PID TTY          TIME CMD
      4305 hvc0     00:00:00 bash
      4480 hvc0     00:00:00 ps
     [root@linux005 ~]# logout




16                                                                        © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What are the differences between iucvtty and IUCV HVC?



     Criteria                                              iucvtty       IUCV HVC device driver
     Origin                                               s390-tools          Linux kernel
     Number of terminal instances                              >8                 <= 8
     Terminal identifiers                                   variable             fixed
     Direct root login                                                           
     Receiving kernel messages                                                   
     Acting as preferred console                                                 
     Restricting access to terminals                                             
                                                        administrative         emergency
     Typical use case
                                                           actions              actions




17                                                                                         © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

  What else can you do with iucvconn?



  ■    Accessing special functions through escape characters
        – Use Ctrl+_ followed by “d” to disconnect terminal sessions

  ■    Creating transcripts of terminal sessions with target systems
        – Writing the terminal data stream to a log file (transcript)
        – Replaying transcripts with realistic output delays


                      brueckh@cetus:~$ ssh brueckner@lnxts
                      Password:
                      brueckner@lnxts:~$ iucvconn -s ~/transcripts/linux005 LINUX005 lnxhvc0
                      [...]

                      brueckner@lnxts:~$ cd transcripts/
                      brueckner@lnxts:~/transcripts$ ls -lA
                      linux005 linux005.info linux005.timing

                      brueckner@lnxts:~/transcripts$ scriptreplay linux005.timing linux005


  18                                                                                 © 2010 IBM Corporation




Notes on escape characters
● iucvconn uses the underscore (_) character as default escape character

● You can change the escape character with the -e, --escape-char option

● You can switch off escaping through specifying -e none




Notes on terminal session transcripts
● Use the -s <file> argument of iucvconn to create a transcript consisting of three files:

        1. <file> contains the raw terminal data stream
        2. <file>.timing contains timing data for replaying using realistic output delays
        3. <file>.info human-readable file containing additional terminal session
        information
● Replay transcripts with the scriptreplay program that is included in the util-linux


package.
Introduction to the Linux on System z Terminal Server over z/VM IUCV

  What can you do with the terminal server shell, called ts-shell?



  ■    ts-shell helps you to
        – Set up a terminal server to simplify system administration by providing a central access
          point
        – Authorize users to establish IUCV terminal connections to specific target systems
        – Improve auditing through creating transcripts of terminal sessions with target systems
        – Restrict users from getting access to the terminal server system

  ■    In a ts-shell session, you can
        – List your authorizations
        – Establish terminal connections




  19                                                                                    © 2010 IBM Corporation




ts-shell commands:
   ●   connect – Establish a terminal session
   ●   list – List authorized target systems
   ●   terminal – Display and set the default terminal ID
   ●   help, version – Display help and version information
   ●   exit, quit – Close terminal server shell session

The ts-shell connect command uses iucvconn to establish terminal sessions.
Thus, ts-shell can reuse iucvconn features like creating session transcripts
and using escape characters.
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How does ts-shell perform authorization checks?



■    Before ts-shell connects to a target system, ts-shell verifies that
      – The user is authorized for the specified target system
      – The target system is included in the global ts-shell authorization

■    ts-shell creates a transcript of a terminal session when
      – The target system is listed in the audit-systems configuration




        user                           ts-shell                             ts-shell                    ts-shell

connect TGSYS                verify user authorization             verify global authorization      start iucvconn


                               ts-authorization.conf                   ts-systems.conf           ts-audit-systems.conf
                                                                       unrestricted.conf


20                                                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

  How can you authorize users for ts-shell?



  1.Creating a group and a user for ts-shell
         groupadd testgrp
         useradd -m -s /usr/bin/ts-shell -g ts-shell -G testgrp bob


  2.Granting authorization to ts-shell users
       – Edit /etc/iucvterm/ts-authorization.conf

         @testgrp = list:linux006,linux007,linux008
         bob = list:linux005




  21                                                                               © 2010 IBM Corporation




Configuring the ts-shell
The ts-shell program reads its configuration from /etc/iucvterm/ts-shell.conf. The ts-shell.conf
file contains settings that specify additional configuration files:
     ●    /etc/iucvterm/unrestricted.conf – Restricting target system connections from ts-shell
     ●    /etc/iucvterm/ts-authorization.conf – Granting authorizations to ts-shell users
     ●    /etc/iucvterm/ts-audit-systems.conf – Configuring session transcripts

Restricting target systems and configuring session transcripts
Both configuration files list z/VM user IDs, each on a separate line.

Granting authorizations to ts-shell users
An authorization statement has the general form: <users> = <list_type>:<targets>
<users> specifies who is authorized to establish connections. <users> can be an individual
Linux user ID or a Linux user group. To distinguish users from groups, groups are prefixed with
an at sign (@).
<list_type>:<targets> specifies the target systems to which connections are authorized.
Target systems can be specified as a comma-separated list (list:), in a list file (file:), or
as a regular expression (regex:).

Examples
● The following authorization statement permits user alice to connect to target systems

  LXGUEST1, LXGUEST3, LXGUEST5, LXGUEST7, and LXGUEST9.
         alice = list:lxguest1,lxguest3,lxguest5,lxguest7,lxguest9
● The following authorization statement permits all users in group testgrp to connect to the


  target systems listed in a file /etc/iucvterm/auth/testsystems.list
         @testgrp = file:/etc/iucvterm/auth/test-systems.list.
● The following authorization statement permits user bob to connect to the target systems:

  LXGUEST0, LXGUEST2, LXGUEST4, LXGUEST6, and LXGUEST8.
         bob = regex:lxguest[02468]
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How do you use ts-shell?
Displaying authorizations and establishing terminal connections with ts-shell


brueckh@cetus:~$ ssh bob@lnxts
Click to add an outline
Password:
Last login: Fri Mar 5 12:01:32 2010 from dyn-9-152-212-21
Welcome to the Terminal Server shell.
Type 'help' to get a list of available commands.


bob@ts-shell> list
linux006
linux007                       bob@ts-shell> connect linux005
linux008                       ts-shell: Connecting to linux005 (terminal identifier: lnxhvc0)...
linux005
bob@ts-shell>                  Red Hat Enterprise Linux Server release 5.4 (Tikanga)
                               Kernel 2.6.18-164.el5 on an s390x

                               linux005 login: root
                               Password:
                               Last login: Fri Mar 5 12:02:45 on hvc0
                               [root@linux005 ~]# ps
                                 PID TTY          TIME CMD
                                1678 hvc0     00:00:00 bash
                                1708 hvc0     00:00:00 ps
                               [root@linux005 ~]# logout
                               ts-shell: Connection ended


22                                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

  How can you secure an IUCV terminal environment?




  23                                                                     © 2010 IBM Corporation




Notes
You configure z/VM IUCV authorizations through the IUCV statement in the
z/VM user directory. Depending on your needs and security policies you can
use different strategies:
   ●   Permit any IUCV connection to a target system:
              IUCV ALLOW
   ●   Permit the terminal server to connect to specific z/VM guest virtual
       machines:
              IUCV LXGUEST1
              IUCV LXGUEST2
   ●   Permit the terminal server to connect to any z/VM guest virtual machine:
              IUCV ANY

You can restrict access to HVC terminal devices and iucvtty instances on target
systems.
   ●  The IUCV HVC device driver includes a z/VM user ID filter which
      specifies the z/VM user IDs that are allowed to connect. You can specify
      an initial filter setting through a kernel parameter. Later, you can list,
      change, or revoke the filter with the chiucvallow program.
   ●  The iucvtty program allows you to specify a z/VM user ID filter on the
      command line.

The IUCV terminal programs do not include support for distributed IUCV.
Introduction to the Linux on System z Terminal Server over z/VM IUCV

Conclusion



■    The terminal server using IUCV helps you to
      – Simplify system administration by providing a central access point
      – Heighten availability by providing emergency access to Linux instances
      – Work more comfortably by using full-screen terminals as alternative to traditional
        mainframe terminals




24                                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

Which Linux distributions include the terminal server using IUCV?



■    Red Hat
      – Red Hat Enterprise Linux 5 Update 4 or higher
      – Red Hat Enterprise Linux 6

■    Novell
      – Novell SUSE Linux Enterprise Server 10 Service Pack 3 or higher
      – Novell SUSE Linux Enterprise Server 11 Service Pack 1 or higher

■    “Upstream” availability
      – Linux kernel 2.6.30 or higher
      – s390-tools 1.8.1 or higher




25                                                                        © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

  Where do you get more information?



  ■    developerWorks
        – How to Set up a Terminal Server Environment (SC34-2596)
        – Device Drivers, Features, and Commands (SC33-8411)

  ■    s390-tools package
        – Man pages for iucvconn(1), iucvtty(1), ts-shell(1), af_iucv(7), and hvc_iucv(9)
        – ts-shell README




  26                                                                                        © 2010 IBM Corporation




http://www.ibm.com/developerworks/linux/linux390/documentation_dev.html
Introduction to the Linux on System z Terminal Server over z/VM IUCV




                                               Thank you!
■    Click to add an outline           Any Questions?


                                                   Hendrik Brückner                IBM Deutschland Research
                                                                                   & Development GmbH
                                                   Linux on System z Development   Schönaicher Strasse 220
                                                                                   71032 Böblingen, Germany

                                                                                   Phone +49 7031 16-1073
                                                                                   brueckner@de.ibm.com




27                                                                                                          © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

Backup



■    Click to add an outline




28                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV



Click to add title
              THANK YOU!
■    Click to add an outline


                                       Your Linux on System z
                                          Requirements?
                 Are you missing a certain feature, functionality, or tool?
                              We'd love to hear from you!

                          We will evaluate each request and (hopefully)
                          develop the additional functionality you need.

                                               Send your input to
                                            brueckner@de.ibm.com


29                                                                            © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What is iucvconn_on_login?



■    iucvconn_on_login is an alternative login shell for setting up a terminal server
      – Log in to Linux with a user ID that matches the z/VM user ID of the target system
      – After a successful login, a terminal session is established and the user is prompted to log
        in to the target system
■    Creating a user for iucvconn_on_login
      – useradd -m -s /usr/bin/iucvconn_on_login lxguest1




30                                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

What can you do if your terminal setup does not work?



■    What if there is no login prompt when you have connected to a HVC terminal?
      – Simply press the Return key to reactivate the getty program.

■    What if getty processes respawn too fast on HVC terminal devices?
     What if getty processes fail to open HVC terminal devices?
      – Check the setting of the hvc_iucv kernel parameter in your boot configuration.
      – Run zipl to write the modified boot configuration and reboot.
      – Check /etc/inittab or upstart job files to configure only activated HVC terminal
        devices. Alternatively, use ttyrun to prevent a respawn loop if a terminal is not
        operational.

■    What if the root user cannot log in on a HVC terminal device?
      – Check if the HVC terminal device is listed in the /etc/securetty file?


31                                                                                  © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How can you restrict access to HVC terminal devices?
Authorizing HVC terminal connections with a z/VM user ID filter


■    The IUCV HVC device driver can accept IUCV connections only from specific terminal
     servers
      – Use the hvc_iucv_allow= kernel parameter to specify a comma-separated list of
        authorized z/VM user IDs

■    The chiucvallow command maintains the hvc_iucv_allow setting (filter) at runtime
      – Display the current z/VM user ID filter with lsiucvallow or chiucvallow -l
      – Clear the z/VM user ID filter with chiucvallow -c
      – Modify the current z/VM user ID filter with chiucvallow -e
      – Verify a z/VM user ID filter, which is saved in a file, with chiucvallow -V
          • You can also verify ts-shell authorization files that list z/VM user IDs




32                                                                                     © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

How do you use the IUCV terminal programs?



■    Using the iucvconn program
       – To access the first z/VM IUCV HVC terminal on the Linux instance in z/VM guest LNXSYS02
           $ iucvconn LNXSYS02 lnxhvc0

       – To create a transcript of the terminal session to the Linux instance in z/VM guest LNXSYS99
           $ iucvconn -s ~/transcripts/lnxsys99 LNXSYS99 lnxhvc0
■    Using the iucvtty program
       – To allow remote logins using the terminal identifier “lnxterm”
           # iucvtty lnxterm
       – To access the “lnxterm” terminal on the Linux instance in z/VM guest LNXSYS01
           $ iucvconn LNXSYS01 lnxterm

       – To use /sbin/sulogin instead of /bin/login for terminal identifier “suterm”
           # iucvtty suterm -- /sbin/sulogin



33                                                                                               © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

  How do you configure Linux instances to provide IUCV terminals?
  Examples using inittab


  ■    Creating new inittab entries for iucvtty instances
        t1:2345:respawn:/usr/bin/iucvtty lnxterm

  ■    Creating new inittab entries for IUCV HVC terminal devices
        – Using the traditional approach:

          h0:2345:respawn:/sbin/agetty -L 9600 hvc0 xterm
        – Using the ttyrun program:

          h1:2345:respawn:/sbin/ttyrun hvc1 /sbin/agetty -L 9600 %t xterm




  34                                                                      © 2010 IBM Corporation




Notes on ttyrun

The ttyrun program is typically started during system initialization and is used to
prevent respawn through the init(8) program when a terminal is not available.
Introduction to the Linux on System z Terminal Server over z/VM IUCV

  How do you configure Linux instances to provide IUCV terminals?
  Examples using upstart job files


  ■    Creating a job file for iucvtty
               start on runlevel [12345]
               stop on runlevel [06]

               respawn
               exec /usr/bin/iucvtty lnxterm
               console none
  ■    Creating a job file for a HVC terminal device
               start on runlevel [12345]
               stop on runlevel [06]

               respawn
               normal exit 42
               exec /sbin/ttyrun -e 42 hvc0 /sbin/mingetty %t




  35                                                                      © 2010 IBM Corporation




Notes on ttyrun

The ttyrun program is typically started during system initialization and is used to
prevent a respawn through the init(8) program when a terminal is not available.
Introduction to the Linux on System z Terminal Server over z/VM IUCV

Which Linux kernel components are involved?



■    Click to add an outline




                             Other                            IUCV
                                                                                       AF_IUCV
                           back-ends                        back-end



                        Hypervisor Console (HVC)                        IUCV base
                           TTY device driver                           device driver

                                TTY core layer
                                                                                            Network core
Kernel space
User space             /dev/hvc0                   /dev/hvc1                                     socket()


36                                                                                                    © 2010 IBM Corporation
Introduction to the Linux on System z Terminal Server over z/VM IUCV

  What does an IUCV terminal environment look like?
  Putting it all together




  37                                                                     © 2010 IBM Corporation




Target systems
Linux instances on the same z/VM to which IUCV terminal connections are
established.

Terminal server
A terminal server is a Linux instance that provides access to terminal devices
on other Linux instances, called target systems. The terminal server and all
target systems run as guest operating systems of the same z/VM instance.
Terminal server and target systems are connected through the z/VM Inter-
User Communication Vehicle (IUCV). From the terminal server, administrators
can access terminal devices on target systems without requiring direct TCP/IP
connections to the target systems.
Introduction to the Linux on System z Terminal Server over z/VM IUCV

  What are Linux terminals and consoles?



  ■    Linux terminals
        – Input/output devices through which users interact with Linux and Linux applications
        – Terminals differ in their modes and capabilities
  ■    Linux consoles
        – Consoles are output devices which display Linux kernel messages
        – The preferred console
            • The preferred console is the device that displays messages during the boot process
              when the 'init' program is called
  ■    Linux terminal device drivers typically combine terminal and console devices




  38                                                                                   © 2010 IBM Corporation




Terminal modes:
   ● Line-mode terminals: 3215
   ● Block-mode terminals: 3270
   ● „Full-screen mode“ terminals: allow advanced interactive capabilities

Terminal capabilities:
   ● Specify terminal initialization sequences, screen positioning, colors, ...

Terminal emulation:
   ● Today, separate physical terminals are rarities.
   ● Programs like xterm, kconsole, etc. emulate real terminals.
   ● The TERM environment variable specifies the set of terminal
     capabilities. The terminal capabilities are stored in „terminfo“ databases.

More Related Content

What's hot

Keynote Speech: Xen ARM Virtualization
Keynote Speech: Xen ARM VirtualizationKeynote Speech: Xen ARM Virtualization
Keynote Speech: Xen ARM VirtualizationThe Linux Foundation
 
Presentation power vm virtualization without limits
Presentation   power vm virtualization without limitsPresentation   power vm virtualization without limits
Presentation power vm virtualization without limitssolarisyougood
 
z/VSE - News - Announcements -Trends
z/VSE - News - Announcements -Trendsz/VSE - News - Announcements -Trends
z/VSE - News - Announcements -TrendsIBM
 
Sierraware ARM hypervisor
Sierraware ARM hypervisor Sierraware ARM hypervisor
Sierraware ARM hypervisor Sierraware
 
Linux Foundation Collaboration Summit 13 :10 years of Xen and Beyond
Linux Foundation Collaboration Summit 13 :10 years of Xen and BeyondLinux Foundation Collaboration Summit 13 :10 years of Xen and Beyond
Linux Foundation Collaboration Summit 13 :10 years of Xen and BeyondThe Linux Foundation
 
Overview of cryptography and enhancements on z/VSE 4.3
Overview of cryptography and enhancements on z/VSE 4.3Overview of cryptography and enhancements on z/VSE 4.3
Overview of cryptography and enhancements on z/VSE 4.3IBM India Smarter Computing
 
Latest news on IBM z/VSE
Latest news on IBM z/VSELatest news on IBM z/VSE
Latest news on IBM z/VSEIBM
 
Presentation power vm common 2012
Presentation   power vm common 2012Presentation   power vm common 2012
Presentation power vm common 2012solarisyougood
 
Presentation cloud computing workshop - virtualization
Presentation   cloud computing workshop - virtualizationPresentation   cloud computing workshop - virtualization
Presentation cloud computing workshop - virtualizationxKinAnx
 
The Architecture Of V Mware Es Xi
The Architecture Of V Mware Es XiThe Architecture Of V Mware Es Xi
The Architecture Of V Mware Es XiRishi Sharma
 
From Zero to Hero – Build your own IBM Client for Smart Work Demonstration ba...
From Zero to Hero – Build your own IBM Client for Smart Work Demonstration ba...From Zero to Hero – Build your own IBM Client for Smart Work Demonstration ba...
From Zero to Hero – Build your own IBM Client for Smart Work Demonstration ba...MaikWeber
 
A z/OS System Programmer’s Guide to Migrating to a New IBM System z9 EC or z9...
A z/OS System Programmer’s Guide to Migrating to a New IBM System z9 EC or z9...A z/OS System Programmer’s Guide to Migrating to a New IBM System z9 EC or z9...
A z/OS System Programmer’s Guide to Migrating to a New IBM System z9 EC or z9...IBM India Smarter Computing
 

What's hot (20)

Keynote Speech: Xen ARM Virtualization
Keynote Speech: Xen ARM VirtualizationKeynote Speech: Xen ARM Virtualization
Keynote Speech: Xen ARM Virtualization
 
XS Boston 2008 SR-IOV
XS Boston 2008 SR-IOVXS Boston 2008 SR-IOV
XS Boston 2008 SR-IOV
 
Presentation power vm virtualization without limits
Presentation   power vm virtualization without limitsPresentation   power vm virtualization without limits
Presentation power vm virtualization without limits
 
z/VSE - News - Announcements -Trends
z/VSE - News - Announcements -Trendsz/VSE - News - Announcements -Trends
z/VSE - News - Announcements -Trends
 
Decision Maker’s Guide
Decision Maker’s GuideDecision Maker’s Guide
Decision Maker’s Guide
 
Sierraware ARM hypervisor
Sierraware ARM hypervisor Sierraware ARM hypervisor
Sierraware ARM hypervisor
 
Linux Foundation Collaboration Summit 13 :10 years of Xen and Beyond
Linux Foundation Collaboration Summit 13 :10 years of Xen and BeyondLinux Foundation Collaboration Summit 13 :10 years of Xen and Beyond
Linux Foundation Collaboration Summit 13 :10 years of Xen and Beyond
 
Overview of cryptography and enhancements on z/VSE 4.3
Overview of cryptography and enhancements on z/VSE 4.3Overview of cryptography and enhancements on z/VSE 4.3
Overview of cryptography and enhancements on z/VSE 4.3
 
Graphics virtualization
Graphics virtualizationGraphics virtualization
Graphics virtualization
 
Latest news on IBM z/VSE
Latest news on IBM z/VSELatest news on IBM z/VSE
Latest news on IBM z/VSE
 
Williams xen summit 2010
Williams   xen summit 2010Williams   xen summit 2010
Williams xen summit 2010
 
Nakajima hvm-be final
Nakajima hvm-be finalNakajima hvm-be final
Nakajima hvm-be final
 
z/VSE V5.1 Update
z/VSE V5.1 Updatez/VSE V5.1 Update
z/VSE V5.1 Update
 
Presentation power vm common 2012
Presentation   power vm common 2012Presentation   power vm common 2012
Presentation power vm common 2012
 
Presentation cloud computing workshop - virtualization
Presentation   cloud computing workshop - virtualizationPresentation   cloud computing workshop - virtualization
Presentation cloud computing workshop - virtualization
 
The Architecture Of V Mware Es Xi
The Architecture Of V Mware Es XiThe Architecture Of V Mware Es Xi
The Architecture Of V Mware Es Xi
 
From Zero to Hero – Build your own IBM Client for Smart Work Demonstration ba...
From Zero to Hero – Build your own IBM Client for Smart Work Demonstration ba...From Zero to Hero – Build your own IBM Client for Smart Work Demonstration ba...
From Zero to Hero – Build your own IBM Client for Smart Work Demonstration ba...
 
A z/OS System Programmer’s Guide to Migrating to a New IBM System z9 EC or z9...
A z/OS System Programmer’s Guide to Migrating to a New IBM System z9 EC or z9...A z/OS System Programmer’s Guide to Migrating to a New IBM System z9 EC or z9...
A z/OS System Programmer’s Guide to Migrating to a New IBM System z9 EC or z9...
 
UDS 2012 Xen
UDS 2012 XenUDS 2012 Xen
UDS 2012 Xen
 
Networking with Linux on System z
Networking with Linux on System zNetworking with Linux on System z
Networking with Linux on System z
 

Viewers also liked

Alien cicatrix español-(dr.corrado malanga)
Alien cicatrix español-(dr.corrado malanga)Alien cicatrix español-(dr.corrado malanga)
Alien cicatrix español-(dr.corrado malanga)ser999humano
 
Um ex libris do notável pintor henrique medina
Um ex libris do notável pintor henrique medinaUm ex libris do notável pintor henrique medina
Um ex libris do notável pintor henrique medinaPedro Abreu Peixoto
 
Staffordshire bull terrier
Staffordshire bull terrierStaffordshire bull terrier
Staffordshire bull terriermerary_vazques
 
Plan social media Kiricocho
Plan social media KiricochoPlan social media Kiricocho
Plan social media KiricochoJuanFontenla
 
2012 CSU Contact Presentation
2012 CSU Contact Presentation2012 CSU Contact Presentation
2012 CSU Contact PresentationCSURIWEB
 
Alfred bester algo ahi arriba me ama
Alfred bester   algo ahi arriba me amaAlfred bester   algo ahi arriba me ama
Alfred bester algo ahi arriba me amaYuly Martinez
 
Trabajo final informática 1er año 2
Trabajo final informática 1er año 2Trabajo final informática 1er año 2
Trabajo final informática 1er año 21cortez
 
Los deportes chutin
Los deportes chutinLos deportes chutin
Los deportes chutinchutin11
 
Nota De Prensa Pre Estreno Maremagnum Fic09
Nota De Prensa Pre Estreno  Maremagnum Fic09Nota De Prensa Pre Estreno  Maremagnum Fic09
Nota De Prensa Pre Estreno Maremagnum Fic09ComedyinSpain
 
Presentación radiologia musculoesqueletica. lesiones oseas....
Presentación radiologia musculoesqueletica. lesiones oseas....Presentación radiologia musculoesqueletica. lesiones oseas....
Presentación radiologia musculoesqueletica. lesiones oseas....anlyrojas
 
Prieto muñoz karen proyecto (fep)
Prieto muñoz karen  proyecto (fep)Prieto muñoz karen  proyecto (fep)
Prieto muñoz karen proyecto (fep)Karen Prieto
 
Estrategias de Mercadear e Interactuar en Twitter
Estrategias de Mercadear e Interactuar en TwitterEstrategias de Mercadear e Interactuar en Twitter
Estrategias de Mercadear e Interactuar en TwitterStwittergy
 
Portus Delphini - Fitocenosi e Carta della Vegetazione del Promontorio di Por...
Portus Delphini - Fitocenosi e Carta della Vegetazione del Promontorio di Por...Portus Delphini - Fitocenosi e Carta della Vegetazione del Promontorio di Por...
Portus Delphini - Fitocenosi e Carta della Vegetazione del Promontorio di Por...Fergus-On
 

Viewers also liked (20)

Alien cicatrix español-(dr.corrado malanga)
Alien cicatrix español-(dr.corrado malanga)Alien cicatrix español-(dr.corrado malanga)
Alien cicatrix español-(dr.corrado malanga)
 
Um ex libris do notável pintor henrique medina
Um ex libris do notável pintor henrique medinaUm ex libris do notável pintor henrique medina
Um ex libris do notável pintor henrique medina
 
Staffordshire bull terrier
Staffordshire bull terrierStaffordshire bull terrier
Staffordshire bull terrier
 
Plan social media Kiricocho
Plan social media KiricochoPlan social media Kiricocho
Plan social media Kiricocho
 
Desperta ferro vol 5
Desperta ferro   vol 5Desperta ferro   vol 5
Desperta ferro vol 5
 
Folleto difusión
Folleto difusiónFolleto difusión
Folleto difusión
 
La Motivacion
La MotivacionLa Motivacion
La Motivacion
 
Galaxy mini gt s5570
Galaxy mini gt s5570Galaxy mini gt s5570
Galaxy mini gt s5570
 
2012 CSU Contact Presentation
2012 CSU Contact Presentation2012 CSU Contact Presentation
2012 CSU Contact Presentation
 
Seminario fia pipra udt concepción
Seminario fia pipra udt concepciónSeminario fia pipra udt concepción
Seminario fia pipra udt concepción
 
Alfred bester algo ahi arriba me ama
Alfred bester   algo ahi arriba me amaAlfred bester   algo ahi arriba me ama
Alfred bester algo ahi arriba me ama
 
Trabajo final informática 1er año 2
Trabajo final informática 1er año 2Trabajo final informática 1er año 2
Trabajo final informática 1er año 2
 
Los deportes chutin
Los deportes chutinLos deportes chutin
Los deportes chutin
 
Nota De Prensa Pre Estreno Maremagnum Fic09
Nota De Prensa Pre Estreno  Maremagnum Fic09Nota De Prensa Pre Estreno  Maremagnum Fic09
Nota De Prensa Pre Estreno Maremagnum Fic09
 
Presentación radiologia musculoesqueletica. lesiones oseas....
Presentación radiologia musculoesqueletica. lesiones oseas....Presentación radiologia musculoesqueletica. lesiones oseas....
Presentación radiologia musculoesqueletica. lesiones oseas....
 
Prieto muñoz karen proyecto (fep)
Prieto muñoz karen  proyecto (fep)Prieto muñoz karen  proyecto (fep)
Prieto muñoz karen proyecto (fep)
 
Estrategias de Mercadear e Interactuar en Twitter
Estrategias de Mercadear e Interactuar en TwitterEstrategias de Mercadear e Interactuar en Twitter
Estrategias de Mercadear e Interactuar en Twitter
 
Los gansos
Los gansosLos gansos
Los gansos
 
Portus Delphini - Fitocenosi e Carta della Vegetazione del Promontorio di Por...
Portus Delphini - Fitocenosi e Carta della Vegetazione del Promontorio di Por...Portus Delphini - Fitocenosi e Carta della Vegetazione del Promontorio di Por...
Portus Delphini - Fitocenosi e Carta della Vegetazione del Promontorio di Por...
 
ATG pravila
ATG pravilaATG pravila
ATG pravila
 

Similar to Introduction to the Linux on System z Terminal Server using z/VM IUCV

MongoDB Linux Porting, Performance Measurements and and Scaling Advantage usi...
MongoDB Linux Porting, Performance Measurements and and Scaling Advantage usi...MongoDB Linux Porting, Performance Measurements and and Scaling Advantage usi...
MongoDB Linux Porting, Performance Measurements and and Scaling Advantage usi...MongoDB
 
Kvm for ibm_z_systems_v1.1.2_limits
Kvm for ibm_z_systems_v1.1.2_limitsKvm for ibm_z_systems_v1.1.2_limits
Kvm for ibm_z_systems_v1.1.2_limitsKrystel Hery
 
z/OS V2.4 Preview: z/OS Container Extensions - Running Linux on Z docker cont...
z/OS V2.4 Preview: z/OS Container Extensions - Running Linux on Z docker cont...z/OS V2.4 Preview: z/OS Container Extensions - Running Linux on Z docker cont...
z/OS V2.4 Preview: z/OS Container Extensions - Running Linux on Z docker cont...zOSCommserver
 
Virtualization aware Java VM
Virtualization aware Java VMVirtualization aware Java VM
Virtualization aware Java VMTim Ellison
 
z/OS V2R2 Communications Server Overview
z/OS V2R2 Communications Server Overviewz/OS V2R2 Communications Server Overview
z/OS V2R2 Communications Server OverviewzOSCommserver
 
z/OS Communications Server Overview
z/OS Communications Server Overviewz/OS Communications Server Overview
z/OS Communications Server OverviewzOSCommserver
 
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso MainframeVisão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso MainframeAnderson Bassani
 
CICS TS for z/VSE Update including CICS connectivity options
CICS TS for z/VSE Update including CICS connectivity optionsCICS TS for z/VSE Update including CICS connectivity options
CICS TS for z/VSE Update including CICS connectivity optionsIBM
 
Power systems virtualization with power kvm
Power systems virtualization with power kvmPower systems virtualization with power kvm
Power systems virtualization with power kvmsolarisyougood
 
OpenStack and z/VM – What is it and how do I get it?
OpenStack and z/VM – What is it and how do I get it?OpenStack and z/VM – What is it and how do I get it?
OpenStack and z/VM – What is it and how do I get it?Anderson Bassani
 
z/VSE Networking Options and News
z/VSE Networking Options and Newsz/VSE Networking Options and News
z/VSE Networking Options and NewsIBM
 
HCLT Whitepaper: Effective Web Hosting on Z/Linux
HCLT Whitepaper: Effective Web Hosting on Z/LinuxHCLT Whitepaper: Effective Web Hosting on Z/Linux
HCLT Whitepaper: Effective Web Hosting on Z/LinuxHCL Technologies
 
Virtualization Everywhere
Virtualization EverywhereVirtualization Everywhere
Virtualization Everywherewebhostingguy
 
Linux on Z13 and Simulatenus Multithreading - Sebastien Llaurency
Linux on Z13 and Simulatenus Multithreading - Sebastien LlaurencyLinux on Z13 and Simulatenus Multithreading - Sebastien Llaurency
Linux on Z13 and Simulatenus Multithreading - Sebastien LlaurencyNRB
 

Similar to Introduction to the Linux on System z Terminal Server using z/VM IUCV (20)

MongoDB Linux Porting, Performance Measurements and and Scaling Advantage usi...
MongoDB Linux Porting, Performance Measurements and and Scaling Advantage usi...MongoDB Linux Porting, Performance Measurements and and Scaling Advantage usi...
MongoDB Linux Porting, Performance Measurements and and Scaling Advantage usi...
 
Kvm for ibm_z_systems_v1.1.2_limits
Kvm for ibm_z_systems_v1.1.2_limitsKvm for ibm_z_systems_v1.1.2_limits
Kvm for ibm_z_systems_v1.1.2_limits
 
z/OS V2.4 Preview: z/OS Container Extensions - Running Linux on Z docker cont...
z/OS V2.4 Preview: z/OS Container Extensions - Running Linux on Z docker cont...z/OS V2.4 Preview: z/OS Container Extensions - Running Linux on Z docker cont...
z/OS V2.4 Preview: z/OS Container Extensions - Running Linux on Z docker cont...
 
ITE7_Chp9.pptx
ITE7_Chp9.pptxITE7_Chp9.pptx
ITE7_Chp9.pptx
 
Virtualization aware Java VM
Virtualization aware Java VMVirtualization aware Java VM
Virtualization aware Java VM
 
z/VM and OpenStack
z/VM and OpenStackz/VM and OpenStack
z/VM and OpenStack
 
z/OS V2R2 Communications Server Overview
z/OS V2R2 Communications Server Overviewz/OS V2R2 Communications Server Overview
z/OS V2R2 Communications Server Overview
 
z/OS Communications Server Overview
z/OS Communications Server Overviewz/OS Communications Server Overview
z/OS Communications Server Overview
 
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso MainframeVisão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
CICS TS for z/VSE Update including CICS connectivity options
CICS TS for z/VSE Update including CICS connectivity optionsCICS TS for z/VSE Update including CICS connectivity options
CICS TS for z/VSE Update including CICS connectivity options
 
VirtFS
VirtFSVirtFS
VirtFS
 
Power systems virtualization with power kvm
Power systems virtualization with power kvmPower systems virtualization with power kvm
Power systems virtualization with power kvm
 
OpenStack and z/VM – What is it and how do I get it?
OpenStack and z/VM – What is it and how do I get it?OpenStack and z/VM – What is it and how do I get it?
OpenStack and z/VM – What is it and how do I get it?
 
z/VSE Networking Options and News
z/VSE Networking Options and Newsz/VSE Networking Options and News
z/VSE Networking Options and News
 
HCLT Whitepaper: Effective Web Hosting on Z/Linux
HCLT Whitepaper: Effective Web Hosting on Z/LinuxHCLT Whitepaper: Effective Web Hosting on Z/Linux
HCLT Whitepaper: Effective Web Hosting on Z/Linux
 
Ibm tivoli security and system z redp4355
Ibm tivoli security and system z redp4355Ibm tivoli security and system z redp4355
Ibm tivoli security and system z redp4355
 
z/VM Live Guest Relocation Planning and Use
z/VM Live Guest Relocation Planning and Usez/VM Live Guest Relocation Planning and Use
z/VM Live Guest Relocation Planning and Use
 
Virtualization Everywhere
Virtualization EverywhereVirtualization Everywhere
Virtualization Everywhere
 
Linux on Z13 and Simulatenus Multithreading - Sebastien Llaurency
Linux on Z13 and Simulatenus Multithreading - Sebastien LlaurencyLinux on Z13 and Simulatenus Multithreading - Sebastien Llaurency
Linux on Z13 and Simulatenus Multithreading - Sebastien Llaurency
 

More from IBM India Smarter Computing

Using the IBM XIV Storage System in OpenStack Cloud Environments
Using the IBM XIV Storage System in OpenStack Cloud Environments Using the IBM XIV Storage System in OpenStack Cloud Environments
Using the IBM XIV Storage System in OpenStack Cloud Environments IBM India Smarter Computing
 
TSL03104USEN Exploring VMware vSphere Storage API for Array Integration on th...
TSL03104USEN Exploring VMware vSphere Storage API for Array Integration on th...TSL03104USEN Exploring VMware vSphere Storage API for Array Integration on th...
TSL03104USEN Exploring VMware vSphere Storage API for Array Integration on th...IBM India Smarter Computing
 
A Comparison of PowerVM and Vmware Virtualization Performance
A Comparison of PowerVM and Vmware Virtualization PerformanceA Comparison of PowerVM and Vmware Virtualization Performance
A Comparison of PowerVM and Vmware Virtualization PerformanceIBM India Smarter Computing
 
IBM pureflex system and vmware vcloud enterprise suite reference architecture
IBM pureflex system and vmware vcloud enterprise suite reference architectureIBM pureflex system and vmware vcloud enterprise suite reference architecture
IBM pureflex system and vmware vcloud enterprise suite reference architectureIBM India Smarter Computing
 

More from IBM India Smarter Computing (20)

Using the IBM XIV Storage System in OpenStack Cloud Environments
Using the IBM XIV Storage System in OpenStack Cloud Environments Using the IBM XIV Storage System in OpenStack Cloud Environments
Using the IBM XIV Storage System in OpenStack Cloud Environments
 
All-flash Needs End to End Storage Efficiency
All-flash Needs End to End Storage EfficiencyAll-flash Needs End to End Storage Efficiency
All-flash Needs End to End Storage Efficiency
 
TSL03104USEN Exploring VMware vSphere Storage API for Array Integration on th...
TSL03104USEN Exploring VMware vSphere Storage API for Array Integration on th...TSL03104USEN Exploring VMware vSphere Storage API for Array Integration on th...
TSL03104USEN Exploring VMware vSphere Storage API for Array Integration on th...
 
IBM FlashSystem 840 Product Guide
IBM FlashSystem 840 Product GuideIBM FlashSystem 840 Product Guide
IBM FlashSystem 840 Product Guide
 
IBM System x3250 M5
IBM System x3250 M5IBM System x3250 M5
IBM System x3250 M5
 
IBM NeXtScale nx360 M4
IBM NeXtScale nx360 M4IBM NeXtScale nx360 M4
IBM NeXtScale nx360 M4
 
IBM System x3650 M4 HD
IBM System x3650 M4 HDIBM System x3650 M4 HD
IBM System x3650 M4 HD
 
IBM System x3300 M4
IBM System x3300 M4IBM System x3300 M4
IBM System x3300 M4
 
IBM System x iDataPlex dx360 M4
IBM System x iDataPlex dx360 M4IBM System x iDataPlex dx360 M4
IBM System x iDataPlex dx360 M4
 
IBM System x3500 M4
IBM System x3500 M4IBM System x3500 M4
IBM System x3500 M4
 
IBM System x3550 M4
IBM System x3550 M4IBM System x3550 M4
IBM System x3550 M4
 
IBM System x3650 M4
IBM System x3650 M4IBM System x3650 M4
IBM System x3650 M4
 
IBM System x3500 M3
IBM System x3500 M3IBM System x3500 M3
IBM System x3500 M3
 
IBM System x3400 M3
IBM System x3400 M3IBM System x3400 M3
IBM System x3400 M3
 
IBM System x3250 M3
IBM System x3250 M3IBM System x3250 M3
IBM System x3250 M3
 
IBM System x3200 M3
IBM System x3200 M3IBM System x3200 M3
IBM System x3200 M3
 
IBM PowerVC Introduction and Configuration
IBM PowerVC Introduction and ConfigurationIBM PowerVC Introduction and Configuration
IBM PowerVC Introduction and Configuration
 
A Comparison of PowerVM and Vmware Virtualization Performance
A Comparison of PowerVM and Vmware Virtualization PerformanceA Comparison of PowerVM and Vmware Virtualization Performance
A Comparison of PowerVM and Vmware Virtualization Performance
 
IBM pureflex system and vmware vcloud enterprise suite reference architecture
IBM pureflex system and vmware vcloud enterprise suite reference architectureIBM pureflex system and vmware vcloud enterprise suite reference architecture
IBM pureflex system and vmware vcloud enterprise suite reference architecture
 
X6: The sixth generation of EXA Technology
X6: The sixth generation of EXA TechnologyX6: The sixth generation of EXA Technology
X6: The sixth generation of EXA Technology
 

Introduction to the Linux on System z Terminal Server using z/VM IUCV

  • 1. Hendrik Brückner, Linux on System z Kernel Development, brueckner@de.ibm.com Introduction to the Linux on System z Terminal Server using z/VM IUCV Discover how terminal connections over z/VM IUCV let you comfortably manage your Linux instances even in emergencies. Linux on System z Live Virtual Class Wednesday, November 17. 2010 1 © 2009 IBM Corporation
  • 2. Introduction to the Linux on System z Terminal Server over z/VM IUCV Trademarks The following are trademarks of the International Business Machines Corporation in the United States, other countries, or both. Not all common law marks used by IBM are listed on this page. Failure of a mark to appear does not mean that IBM does not use the mark nor does it mean that the product is not actively marketed or is not significant within its relevant market. Those trademarks followed by ® are registered trademarks of IBM in the United States; all others are trademarks or common law marks of IBM in the United States. For a complete list of IBM Trademarks, see www.ibm.com/legal/copytrade.shtml: *, AS/400®, e business(logo)®, DBE, ESCO, eServer, FICON, IBM®, IBM (logo)®, iSeries®, MVS, OS/390®, pSeries®, RS/6000®, S/30, VM/ESA®, VSE/ESA, WebSphere®, xSeries®, z/OS®, zSeries®, z/VM®, System i, System i5, System p, System p5, System x, System z, System z9®, BladeCenter® The following are trademarks or registered trademarks of other companies. Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries. Cell Broadband Engine is a trademark of Sony Computer Entertainment, Inc. in the United States, other countries, or both and is used under license therefrom. Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both. Intel, Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino logo, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. UNIX is a registered trademark of The Open Group in the United States and other countries. Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. ITIL is a registered trademark, and a registered community trademark of the Office of Government Commerce, and is registered in the U.S. Patent and Trademark Office. IT Infrastructure Library is a registered trademark of the Central Computer and Telecommunications Agency, which is now part of the Office of Government Commerce. * All other products may be trademarks or registered trademarks of their respective companies. Notes: Performance is in Internal Throughput Rate (ITR) ratio based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput that any user will experience will vary depending upon considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve throughput improvements equivalent to the performance ratios stated here. IBM hardware products are manufactured from new parts, or new and serviceable used parts. Regardless, our warranty terms apply. All customer examples cited or described in this presentation are presented as illustrations of the manner in which some customers have used IBM products and the results they may have achieved. Actual environmental costs and performance characteristics will vary depending on individual customer configurations and conditions. This publication was produced in the United States. IBM may not offer the products, services or features discussed in this document in other countries, and the information may be subject to change without notice. Consult your local IBM business contact for information on the product or services available in your area. All statements regarding IBM's future direction and intent are subject to change or withdrawal without notice, and represent goals and objectives only. Information about non-IBM products is obtained from the manufacturers of those products or their published announcements. IBM has not tested those products and cannot confirm the performance, compatibility, or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. Prices subject to change without notice. Contact your IBM representative or Business Partner for the most current pricing in your geography. 2 © 2010 IBM Corporation
  • 3. Introduction to the Linux on System z Terminal Server over z/VM IUCV What's on the agenda? ■ How can the terminal server using IUCV help you? ■ What does an IUCV terminal environment look like? – How can you establish terminal sessions? – How can you set up your IUCV terminal environment? 3 © 2010 IBM Corporation
  • 4. Introduction to the Linux on System z Terminal Server over z/VM IUCV Why do you need a terminal server using z/VM IUCV? ■ Ask yourself – Are you sick and tired of reconfiguring your Linux instances using a line-mode terminal? – How often have you struggled using “ed” to correct configuration files? • For example, replacing the IP address in the network configuration – Why not using vi or emacs? 4 © 2010 IBM Corporation
  • 5. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can the terminal server using IUCV help you? ■ Full-screen terminal access to Linux instances on the same z/VM ■ Access to Linux instances that are not connected to an Internet Protocol (IP) network ■ Use cases – Provide an alternative terminal access to 3270 and 3215 line-mode terminals – Increase availability by providing emergency access if the network for a system fails – Centralize access to systems by providing a terminal server environment – Heighten security by separating user networks from administrator networks or by isolating sensitive Linux instances from public IP networks 5 © 2010 IBM Corporation
  • 6. Introduction to the Linux on System z Terminal Server over z/VM IUCV What are terminals and what is z/VM IUCV? ■ Linux terminals and consoles – Input/output devices through which users interact with Linux and Linux applications – Terminals differ in their modes and capabilities – Consoles are output devices which display Linux kernel messages • The preferred console displays messages during the boot process ■ Inter-user communication vehicle (IUCV) – A z/VM CP interface for passing data between virtual machines or between CP and a virtual machine – The Linux kernel includes IUCV • AF_IUCV – Addressing family for network sockets • IUCV hypervisor console (HVC) terminal device driver 6 © 2010 IBM Corporation
  • 7. Introduction to the Linux on System z Terminal Server over z/VM IUCV What does an IUCV terminal environment look like? Overview and terminology Terminal Server Target Systems User's SSH Workstation Linux Linux Linux Linux Linux IUCV z/VM system 7 © 2010 IBM Corporation
  • 8. Introduction to the Linux on System z Terminal Server over z/VM IUCV Which programs do you use in an IUCV terminal environment? ■ IUCV terminal programs (s390-tools) – iucvconn – Start terminal connection over IUCV – iucvtty – Allow remote logins over IUCV – ts-shell – Login shell for setting up a terminal server using IUCV – chiucvallow – Restrict access to IUCV HVC terminal devices ■ Terminal access over IUCV is provided by – iucvtty instances – IUCV hypervisor console (HVC) device driver (Linux kernel) 8 © 2010 IBM Corporation
  • 9. Introduction to the Linux on System z Terminal Server over z/VM IUCV What does an IUCV terminal environment look like? 9 © 2010 IBM Corporation
  • 10. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you enable a terminal server for iucvconn? ■ Authorizing the z/VM guest virtual machine for IUCV – Adding an IUCV user directory statement, for example, IUCV ANY – The z/VM user directory for a terminal server might look like: USER LNXTS XSECRETX 768M 1G G * General statements IPL 0150 MACH ESA 8 * IUCV authorization IUCV ANY OPTION MAXCONN 128 * Generic device statements CONSOLE 0009 3215 T SPOOL 000C 2540 READER * * ... 10 © 2010 IBM Corporation
  • 11. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you establish IUCV terminal sessions? Establishing terminal sessions to iucvtty instances ■ iucvconn establishes terminal sessions – Socket communication is based on the AF_IUCV address family – Addressing is based on the z/VM user ID and a terminal identifier (“term1”) ■ iucvtty waits for incoming connections and starts /bin/login to log on users 11 © 2010 IBM Corporation
  • 12. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you set up iucvtty instances on target systems? 1.Choosing a terminal identifier – For example: term1 2.Enabling user logins – Start the iucvtty program through /etc/inittab i1:2345:respawn:/usr/bin/iucvtty term1 12 © 2010 IBM Corporation
  • 13. Introduction to the Linux on System z Terminal Server over z/VM IUCV How do you use iucvconn? Establishing terminal connections with iucvconn to iucvtty instances brueckh@cetus:~$ ssh brueckner@lnxts Password: brueckner@lnxts:~$ iucvconn LINUX005 term1 login: brueckner Password: [brueckner@linux005 ~]$ ls [brueckner@linux005 ~]$ ps PID TTY TIME CMD 1731 pts/0 00:00:00 bash 1762 pts/0 00:00:00 ps [brueckner@linux005 ~]$ 13 © 2010 IBM Corporation
  • 14. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you establish IUCV terminal sessions? Establishing terminal sessions to HVC terminal devices ■ IUCV HVC device driver provides up to 8 terminal devices (/dev/hvc0 .. /dev/hvc7) – Using the terminal identifiers “lnxhvc0” through “lnxhvc7” 14 © 2010 IBM Corporation
  • 15. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you set up HVC terminal devices on target systems? 1.Specifying the number of IUCV HVC terminal devices – Set kernel parameter: hvc_iucv=2 2.Enabling user logins – Start a getty program on each terminal through /etc/inittab h0:2345:respawn:/sbin/mingetty hvc0 h1:2345:respawn:/sbin/agetty -L 9600 hvc1 xterm 3.Permitting root logins – List HVC terminal devices in /etc/securetty 4.Activating hvc0 to receive Linux kernel messages – Set kernel parameter: console=hvc0 console=ttyS0 15 © 2010 IBM Corporation
  • 16. Introduction to the Linux on System z Terminal Server over z/VM IUCV How do you use iucvconn? Establishing terminal connections with iucvconn to HVC terminal devices brueckh@cetus:~$ ssh brueckner@lnxts Password: brueckner@lnxts:~$ iucvconn LINUX005 lnxhvc0 Red Hat Enterprise Linux Server release 5.4 (Tikanga) Kernel 2.6.18-164.el5 on an s390x linux005 login: root Password: Last login: Fri Mar 5 14:31:23 on hvc0 [root@linux005 ~]# ps PID TTY TIME CMD 4305 hvc0 00:00:00 bash 4480 hvc0 00:00:00 ps [root@linux005 ~]# logout 16 © 2010 IBM Corporation
  • 17. Introduction to the Linux on System z Terminal Server over z/VM IUCV What are the differences between iucvtty and IUCV HVC? Criteria iucvtty IUCV HVC device driver Origin s390-tools Linux kernel Number of terminal instances >8 <= 8 Terminal identifiers variable fixed Direct root login   Receiving kernel messages   Acting as preferred console   Restricting access to terminals   administrative emergency Typical use case actions actions 17 © 2010 IBM Corporation
  • 18. Introduction to the Linux on System z Terminal Server over z/VM IUCV What else can you do with iucvconn? ■ Accessing special functions through escape characters – Use Ctrl+_ followed by “d” to disconnect terminal sessions ■ Creating transcripts of terminal sessions with target systems – Writing the terminal data stream to a log file (transcript) – Replaying transcripts with realistic output delays brueckh@cetus:~$ ssh brueckner@lnxts Password: brueckner@lnxts:~$ iucvconn -s ~/transcripts/linux005 LINUX005 lnxhvc0 [...] brueckner@lnxts:~$ cd transcripts/ brueckner@lnxts:~/transcripts$ ls -lA linux005 linux005.info linux005.timing brueckner@lnxts:~/transcripts$ scriptreplay linux005.timing linux005 18 © 2010 IBM Corporation
  • 19. Introduction to the Linux on System z Terminal Server over z/VM IUCV What can you do with the terminal server shell, called ts-shell? ■ ts-shell helps you to – Set up a terminal server to simplify system administration by providing a central access point – Authorize users to establish IUCV terminal connections to specific target systems – Improve auditing through creating transcripts of terminal sessions with target systems – Restrict users from getting access to the terminal server system ■ In a ts-shell session, you can – List your authorizations – Establish terminal connections 19 © 2010 IBM Corporation
  • 20. Introduction to the Linux on System z Terminal Server over z/VM IUCV How does ts-shell perform authorization checks? ■ Before ts-shell connects to a target system, ts-shell verifies that – The user is authorized for the specified target system – The target system is included in the global ts-shell authorization ■ ts-shell creates a transcript of a terminal session when – The target system is listed in the audit-systems configuration user ts-shell ts-shell ts-shell connect TGSYS verify user authorization verify global authorization start iucvconn ts-authorization.conf ts-systems.conf ts-audit-systems.conf unrestricted.conf 20 © 2010 IBM Corporation
  • 21. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you authorize users for ts-shell? 1.Creating a group and a user for ts-shell groupadd testgrp useradd -m -s /usr/bin/ts-shell -g ts-shell -G testgrp bob 2.Granting authorization to ts-shell users – Edit /etc/iucvterm/ts-authorization.conf @testgrp = list:linux006,linux007,linux008 bob = list:linux005 21 © 2010 IBM Corporation
  • 22. Introduction to the Linux on System z Terminal Server over z/VM IUCV How do you use ts-shell? Displaying authorizations and establishing terminal connections with ts-shell brueckh@cetus:~$ ssh bob@lnxts Password: Last login: Fri Mar 5 12:01:32 2010 from dyn-9-152-212-21 Welcome to the Terminal Server shell. Type 'help' to get a list of available commands. bob@ts-shell> list linux006 linux007 bob@ts-shell> connect linux005 linux008 ts-shell: Connecting to linux005 (terminal identifier: lnxhvc0)... linux005 bob@ts-shell> Red Hat Enterprise Linux Server release 5.4 (Tikanga) Kernel 2.6.18-164.el5 on an s390x linux005 login: root Password: Last login: Fri Mar 5 12:02:45 on hvc0 [root@linux005 ~]# ps PID TTY TIME CMD 1678 hvc0 00:00:00 bash 1708 hvc0 00:00:00 ps [root@linux005 ~]# logout ts-shell: Connection ended 22 © 2010 IBM Corporation
  • 23. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you secure an IUCV terminal environment? 23 © 2010 IBM Corporation
  • 24. Introduction to the Linux on System z Terminal Server over z/VM IUCV Conclusion ■ The terminal server using IUCV helps you to – Simplify system administration by providing a central access point – Heighten availability by providing emergency access to Linux instances – Work more comfortably by using full-screen terminals as alternative to traditional mainframe terminals 24 © 2010 IBM Corporation
  • 25. Introduction to the Linux on System z Terminal Server over z/VM IUCV Which Linux distributions include the terminal server using IUCV? ■ Red Hat – Red Hat Enterprise Linux 5 Update 4 or higher – Red Hat Enterprise Linux 6 ■ Novell – Novell SUSE Linux Enterprise Server 10 Service Pack 3 or higher – Novell SUSE Linux Enterprise Server 11 Service Pack 1 or higher ■ “Upstream” availability – Linux kernel 2.6.30 or higher – s390-tools 1.8.1 or higher 25 © 2010 IBM Corporation
  • 26. Introduction to the Linux on System z Terminal Server over z/VM IUCV Where do you get more information? ■ developerWorks – How to Set up a Terminal Server Environment (SC34-2596) – Device Drivers, Features, and Commands (SC33-8411) ■ s390-tools package – Man pages for iucvconn(1), iucvtty(1), ts-shell(1), af_iucv(7), and hvc_iucv(9) – ts-shell README 26 © 2010 IBM Corporation
  • 27. Introduction to the Linux on System z Terminal Server over z/VM IUCV Thank you! Any Questions? Hendrik Brückner IBM Deutschland Research & Development GmbH Linux on System z Development Schönaicher Strasse 220 71032 Böblingen, Germany Phone +49 7031 16-1073 brueckner@de.ibm.com 27 © 2010 IBM Corporation
  • 28. Introduction to the Linux on System z Terminal Server over z/VM IUCV Backup 28 © 2010 IBM Corporation
  • 29. Introduction to the Linux on System z Terminal Server over z/VM IUCV THANK YOU! Your Linux on System z Requirements? Are you missing a certain feature, functionality, or tool? We'd love to hear from you! We will evaluate each request and (hopefully) develop the additional functionality you need. Send your input to brueckner@de.ibm.com 29 © 2010 IBM Corporation
  • 30. Introduction to the Linux on System z Terminal Server over z/VM IUCV What is iucvconn_on_login? ■ iucvconn_on_login is an alternative login shell for setting up a terminal server – Log in to Linux with a user ID that matches the z/VM user ID of the target system – After a successful login, a terminal session is established and the user is prompted to log in to the target system ■ Creating a user for iucvconn_on_login – useradd -m -s /usr/bin/iucvconn_on_login lxguest1 30 © 2010 IBM Corporation
  • 31. Introduction to the Linux on System z Terminal Server over z/VM IUCV What can you do if your terminal setup does not work? ■ What if there is no login prompt when you have connected to a HVC terminal? – Simply press the Return key to reactivate the getty program. ■ What if getty processes respawn too fast on HVC terminal devices? What if getty processes fail to open HVC terminal devices? – Check the setting of the hvc_iucv kernel parameter in your boot configuration. – Run zipl to write the modified boot configuration and reboot. – Check /etc/inittab or upstart job files to configure only activated HVC terminal devices. Alternatively, use ttyrun to prevent a respawn loop if a terminal is not operational. ■ What if the root user cannot log in on a HVC terminal device? – Check if the HVC terminal device is listed in the /etc/securetty file? 31 © 2010 IBM Corporation
  • 32. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you restrict access to HVC terminal devices? Authorizing HVC terminal connections with a z/VM user ID filter ■ The IUCV HVC device driver can accept IUCV connections only from specific terminal servers – Use the hvc_iucv_allow= kernel parameter to specify a comma-separated list of authorized z/VM user IDs ■ The chiucvallow command maintains the hvc_iucv_allow setting (filter) at runtime – Display the current z/VM user ID filter with lsiucvallow or chiucvallow -l – Clear the z/VM user ID filter with chiucvallow -c – Modify the current z/VM user ID filter with chiucvallow -e – Verify a z/VM user ID filter, which is saved in a file, with chiucvallow -V • You can also verify ts-shell authorization files that list z/VM user IDs 32 © 2010 IBM Corporation
  • 33. Introduction to the Linux on System z Terminal Server over z/VM IUCV How do you use the IUCV terminal programs? ■ Using the iucvconn program – To access the first z/VM IUCV HVC terminal on the Linux instance in z/VM guest LNXSYS02 $ iucvconn LNXSYS02 lnxhvc0 – To create a transcript of the terminal session to the Linux instance in z/VM guest LNXSYS99 $ iucvconn -s ~/transcripts/lnxsys99 LNXSYS99 lnxhvc0 ■ Using the iucvtty program – To allow remote logins using the terminal identifier “lnxterm” # iucvtty lnxterm – To access the “lnxterm” terminal on the Linux instance in z/VM guest LNXSYS01 $ iucvconn LNXSYS01 lnxterm – To use /sbin/sulogin instead of /bin/login for terminal identifier “suterm” # iucvtty suterm -- /sbin/sulogin 33 © 2010 IBM Corporation
  • 34. Introduction to the Linux on System z Terminal Server over z/VM IUCV How do you configure Linux instances to provide IUCV terminals? Examples using inittab ■ Creating new inittab entries for iucvtty instances t1:2345:respawn:/usr/bin/iucvtty lnxterm ■ Creating new inittab entries for IUCV HVC terminal devices – Using the traditional approach: h0:2345:respawn:/sbin/agetty -L 9600 hvc0 xterm – Using the ttyrun program: h1:2345:respawn:/sbin/ttyrun hvc1 /sbin/agetty -L 9600 %t xterm 34 © 2010 IBM Corporation
  • 35. Introduction to the Linux on System z Terminal Server over z/VM IUCV How do you configure Linux instances to provide IUCV terminals? Examples using upstart job files ■ Creating a job file for iucvtty start on runlevel [12345] stop on runlevel [06] respawn exec /usr/bin/iucvtty lnxterm console none ■ Creating a job file for a HVC terminal device start on runlevel [12345] stop on runlevel [06] respawn normal exit 42 exec /sbin/ttyrun -e 42 hvc0 /sbin/mingetty %t 35 © 2010 IBM Corporation
  • 36. Introduction to the Linux on System z Terminal Server over z/VM IUCV Which Linux kernel components are involved? Other IUCV AF_IUCV back-ends back-end Hypervisor Console (HVC) IUCV base TTY device driver device driver TTY core layer Network core Kernel space User space /dev/hvc0 /dev/hvc1 socket() 36 © 2010 IBM Corporation
  • 37. Introduction to the Linux on System z Terminal Server over z/VM IUCV What does an IUCV terminal environment look like? Putting it all together 37 © 2010 IBM Corporation
  • 38. Introduction to the Linux on System z Terminal Server over z/VM IUCV What are Linux terminals and consoles? ■ Linux terminals – Input/output devices through which users interact with Linux and Linux applications – Terminals differ in their modes and capabilities ■ Linux consoles – Consoles are output devices which display Linux kernel messages – The preferred console • The preferred console is the device that displays messages during the boot process when the 'init' program is called ■ Linux terminal device drivers typically combine terminal and console devices 38 © 2010 IBM Corporation
  • 39. Hendrik Brückner, Linux on System z Kernel Development, brueckner@de.ibm.com Introduction to the Linux on System z Terminal Server using z/VM IUCV Discover how terminal connections over z/VM IUCV let you comfortably manage your Linux instances even in emergencies. Linux on System z Live Virtual Class Wednesday, November 17. 2010 1 1 © 2009 IBM Corporation
  • 40. Introduction to the Linux on System z Terminal Server over z/VM IUCV Trademarks The following are trademarks of the International Business Machines Corporation in the United States, other countries, or both. Not all common law marks used by IBM are listed on this page. Failure of a mark to appear does not mean that IBM does not use the mark nor does it mean that the product is not actively marketed or is not significant within its relevant market. Those trademarks followed by ® are registered trademarks of IBM in the United States; all others are trademarks or common law marks of IBM in the United States. For a complete list of IBM Trademarks, see www.ibm.com/legal/copytrade.shtml: *, AS/400®, e business(logo)®, DBE, ESCO, eServer, FICON, IBM®, IBM (logo)®, iSeries®, MVS, OS/390®, pSeries®, RS/6000®, S/30, VM/ESA®, VSE/ESA, WebSphere®, xSeries®, z/OS®, zSeries®, z/VM®, System i, System i5, System p, System p5, System x, System z, System z9®, BladeCenter® The following are trademarks or registered trademarks of other companies. Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries. Cell Broadband Engine is a trademark of Sony Computer Entertainment, Inc. in the United States, other countries, or both and is used under license therefrom. Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both. Intel, Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino logo, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. UNIX is a registered trademark of The Open Group in the United States and other countries. Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. ITIL is a registered trademark, and a registered community trademark of the Office of Government Commerce, and is registered in the U.S. Patent and Trademark Office. IT Infrastructure Library is a registered trademark of the Central Computer and Telecommunications Agency, which is now part of the Office of Government Commerce. * All other products may be trademarks or registered trademarks of their respective companies. Notes: Performance is in Internal Throughput Rate (ITR) ratio based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput that any user will experience will vary depending upon considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve throughput improvements equivalent to the performance ratios stated here. IBM hardware products are manufactured from new parts, or new and serviceable used parts. Regardless, our warranty terms apply. All customer examples cited or described in this presentation are presented as illustrations of the manner in which some customers have used IBM products and the results they may have achieved. Actual environmental costs and performance characteristics will vary depending on individual customer configurations and conditions. This publication was produced in the United States. IBM may not offer the products, services or features discussed in this document in other countries, and the information may be subject to change without notice. Consult your local IBM business contact for information on the product or services available in your area. All statements regarding IBM's future direction and intent are subject to change or withdrawal without notice, and represent goals and objectives only. Information about non-IBM products is obtained from the manufacturers of those products or their published announcements. IBM has not tested those products and cannot confirm the performance, compatibility, or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. Prices subject to change without notice. Contact your IBM representative or Business Partner for the most current pricing in your geography. 2 © 2010 IBM Corporation
  • 41. Introduction to the Linux on System z Terminal Server over z/VM IUCV What's on the agenda? ■ How can the terminal server using IUCV help you? ■ What does an IUCV terminal environment look like? – How can you establish terminal sessions? – How can you set up your IUCV terminal environment? 3 © 2010 IBM Corporation
  • 42. Introduction to the Linux on System z Terminal Server over z/VM IUCV Why do you need a terminal server using z/VM IUCV? ■ Ask yourself – Are you sick and tired of reconfiguring your Linux instances using a line-mode terminal? – How often have you struggled using “ed” to correct configuration files? • For example, replacing the IP address in the network configuration – Why not using vi or emacs? 4 © 2010 IBM Corporation
  • 43. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can the terminal server using IUCV help you? ■ Full-screen terminal access to Linux instances on the same z/VM ■ Access to Linux instances that are not connected to an Internet Protocol (IP) network ■ Use cases – Provide an alternative terminal access to 3270 and 3215 line-mode terminals – Increase availability by providing emergency access if the network for a system fails – Centralize access to systems by providing a terminal server environment – Heighten security by separating user networks from administrator networks or by isolating sensitive Linux instances from public IP networks 5 © 2010 IBM Corporation
  • 44. Introduction to the Linux on System z Terminal Server over z/VM IUCV What are terminals and what is z/VM IUCV? ■ Linux terminals and consoles – Input/output devices through which users interact with Linux and Linux applications – Terminals differ in their modes and capabilities – Consoles are output devices which display Linux kernel messages • The preferred console displays messages during the boot process ■ Inter-user communication vehicle (IUCV) – A z/VM CP interface for passing data between virtual machines or between CP and a virtual machine – The Linux kernel includes IUCV • AF_IUCV – Addressing family for network sockets • IUCV hypervisor console (HVC) terminal device driver 6 © 2010 IBM Corporation Terminal modes: ● Line-mode terminals: 3215 ● Block-mode terminals: 3270 ● „Full-screen mode“ terminals: allow advanced interactive capabilities Terminal capabilities: ● Specify terminal initialization sequences, screen positioning, colors, ... Terminal emulation: ● Today, separate physical terminals are rarities. ● Programs like xterm, kconsole, etc. emulate real terminals. ● The TERM environment variable specifies the set of terminal capabilities. The terminal capabilities are stored in „terminfo“ databases.
  • 45. Introduction to the Linux on System z Terminal Server over z/VM IUCV What does an IUCV terminal environment look like? Overview and terminology Terminal Server Target Systems User's SSH Workstation Linux Linux Linux Linux Linux IUCV z/VM system 7 © 2010 IBM Corporation
  • 46. Introduction to the Linux on System z Terminal Server over z/VM IUCV Which programs do you use in an IUCV terminal environment? ■ IUCV terminal programs (s390-tools) – iucvconn – Start terminal connection over IUCV – iucvtty – Allow remote logins over IUCV – ts-shell – Login shell for setting up a terminal server using IUCV – chiucvallow – Restrict access to IUCV HVC terminal devices ■ Terminal access over IUCV is provided by – iucvtty instances – IUCV hypervisor console (HVC) device driver (Linux kernel) 8 © 2010 IBM Corporation General: ● The Linux instances must be z/VM guest operating systems of the same z/VM ● Security hints: ● IUCV authorization for the z/VM guest virtual machine ● z/VM user ID filter for iucvtty instances and the z/VM IUCV HVC device driver iucvconn: ● Establishes IUCV connections to either iucvtty instances or HVC terminal devices ● Supports session logging; use „scriptreplay“ to replay transcripts ts-shell: ● Authorizes Linux users based on user names and group memberships for accessing terminals ● Linux users can list the authorizations and access terminals. If a user is authorized to access a terminal, iucvconn is started. lsiucvallow, chiucvallow: ● List, verify, and change the z/VM user ID filter of the IUCV HVC device driver. The filter specifies the z/VM user IDs that are authorized to access HVC terminal devices. iucvtty: ● Terminal login on pseudo-terminal devices (pts) using /bin/login ● For security reason, /bin/login does not permit the root user to log in on pseudo- terminal devices. z/VM IUCV hypervisor console (HVC) device driver (Linux kernel): ● provides up to 8 terminals ● the first terminal can be activated as (preferred) Linux console
  • 47. Introduction to the Linux on System z Terminal Server over z/VM IUCV What does an IUCV terminal environment look like? 9 © 2010 IBM Corporation
  • 48. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you enable a terminal server for iucvconn? ■ Authorizing the z/VM guest virtual machine for IUCV – Adding an IUCV user directory statement, for example, IUCV ANY – The z/VM user directory for a terminal server might look like: USER LNXTS XSECRETX 768M 1G G * General statements IPL 0150 MACH ESA 8 * IUCV authorization IUCV ANY OPTION MAXCONN 128 * Generic device statements CONSOLE 0009 3215 T SPOOL 000C 2540 READER * * ... 10 © 2010 IBM Corporation Notes You configure z/VM IUCV authorizations through the IUCV statement in the z/VM user directory. Depending on your needs and security policies you can use different strategies: ● Permit any IUCV connection to a target system: IUCV ALLOW ● Permit the terminal server to connect to specific z/VM guest virtual machines: IUCV LXGUEST1 IUCV LXGUEST2 ● Permit the terminal server to connect to any z/VM guest virtual machine: IUCV ANY
  • 49. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you establish IUCV terminal sessions? Establishing terminal sessions to iucvtty instances ■ iucvconn establishes terminal sessions – Socket communication is based on the AF_IUCV address family – Addressing is based on the z/VM user ID and a terminal identifier (“term1”) ■ iucvtty waits for incoming connections and starts /bin/login to log on users 11 © 2010 IBM Corporation
  • 50. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you set up iucvtty instances on target systems? 1.Choosing a terminal identifier – For example: term1 2.Enabling user logins – Start the iucvtty program through /etc/inittab i1:2345:respawn:/usr/bin/iucvtty term1 12 © 2010 IBM Corporation
  • 51. Introduction to the Linux on System z Terminal Server over z/VM IUCV How do you use iucvconn? Establishing terminal connections with iucvconn to iucvtty instances Click to add an outline brueckh@cetus:~$ ssh brueckner@lnxts Password: brueckner@lnxts:~$ iucvconn LINUX005 term1 login: brueckner Password: [brueckner@linux005 ~]$ ls [brueckner@linux005 ~]$ ps PID TTY TIME CMD 1731 pts/0 00:00:00 bash 1762 pts/0 00:00:00 ps [brueckner@linux005 ~]$ 13 © 2010 IBM Corporation
  • 52. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you establish IUCV terminal sessions? Establishing terminal sessions to HVC terminal devices ■ IUCV HVC device driver provides up to 8 terminal devices (/dev/hvc0 .. /dev/hvc7) – Using the terminal identifiers “lnxhvc0” through “lnxhvc7” 14 © 2010 IBM Corporation The z/VM IUCV HVC device driver supports the following kernel parameters: ● hvc_iucv=number Specifies the number of IUCV HVC terminals (max 8). ● hvc_iucv_allow=list Specifies a list of comma-separated z/VM user IDs which are authorized to access. At runtime, the filter can be modified with the chiucvallow program.
  • 53. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you set up HVC terminal devices on target systems? 1.Specifying the number of IUCV HVC terminal devices – Set kernel parameter: hvc_iucv=2 2.Enabling user logins – Start a getty program on each terminal through /etc/inittab h0:2345:respawn:/sbin/mingetty hvc0 h1:2345:respawn:/sbin/agetty -L 9600 hvc1 xterm 3.Permitting root logins – List HVC terminal devices in /etc/securetty 4.Activating hvc0 to receive Linux kernel messages – Set kernel parameter: console=hvc0 console=ttyS0 15 © 2010 IBM Corporation Setting kernel parameters ● Edit /etc/zipl.conf to add or change the kernel parameters ● Run zipl to write a new boot record with the updated configuration Activating consoles to receive Linux kernel messages If you want terminal devices to be activated to receive Linux kernel messages, specify a console statement for each of these other devices. The last console statement designates the preferred console. The default preferred console on a Linux on System z system is ttyS0. If you specify one or more console parameters and you want to keep ttyS0 as the preferred console, add a console parameter for ttyS0 as the last console statement. If you specify console=hvc0 only, hvc0 becomes the preferred console. Specify console=hvc0 console=ttyS0 to receive kernel messages on both devices but keep ttyS0 as the preferred console. Permitting root logins The default login program for HVC terminal devices and iucvtty, /bin/login, restricts root logins. Root logins are allowed only on devices that are listed in /etc/securetty. iucvtty uses pseudo-terminal (pts) devices to communicate with the login program. For security reasons, login programs, like /bin/login, do not permit root logins on pseudo- terminal devices (see also the man-page for securetty(5)).
  • 54. Introduction to the Linux on System z Terminal Server over z/VM IUCV How do you use iucvconn? Establishing terminal connections with iucvconn to HVC terminal devices Click to add an outline ssh brueckner@lnxts brueckh@cetus:~$ Password: brueckner@lnxts:~$ iucvconn LINUX005 lnxhvc0 Red Hat Enterprise Linux Server release 5.4 (Tikanga) Kernel 2.6.18-164.el5 on an s390x linux005 login: root Password: Last login: Fri Mar 5 14:31:23 on hvc0 [root@linux005 ~]# ps PID TTY TIME CMD 4305 hvc0 00:00:00 bash 4480 hvc0 00:00:00 ps [root@linux005 ~]# logout 16 © 2010 IBM Corporation
  • 55. Introduction to the Linux on System z Terminal Server over z/VM IUCV What are the differences between iucvtty and IUCV HVC? Criteria iucvtty IUCV HVC device driver Origin s390-tools Linux kernel Number of terminal instances >8 <= 8 Terminal identifiers variable fixed Direct root login   Receiving kernel messages   Acting as preferred console   Restricting access to terminals   administrative emergency Typical use case actions actions 17 © 2010 IBM Corporation
  • 56. Introduction to the Linux on System z Terminal Server over z/VM IUCV What else can you do with iucvconn? ■ Accessing special functions through escape characters – Use Ctrl+_ followed by “d” to disconnect terminal sessions ■ Creating transcripts of terminal sessions with target systems – Writing the terminal data stream to a log file (transcript) – Replaying transcripts with realistic output delays brueckh@cetus:~$ ssh brueckner@lnxts Password: brueckner@lnxts:~$ iucvconn -s ~/transcripts/linux005 LINUX005 lnxhvc0 [...] brueckner@lnxts:~$ cd transcripts/ brueckner@lnxts:~/transcripts$ ls -lA linux005 linux005.info linux005.timing brueckner@lnxts:~/transcripts$ scriptreplay linux005.timing linux005 18 © 2010 IBM Corporation Notes on escape characters ● iucvconn uses the underscore (_) character as default escape character ● You can change the escape character with the -e, --escape-char option ● You can switch off escaping through specifying -e none Notes on terminal session transcripts ● Use the -s <file> argument of iucvconn to create a transcript consisting of three files: 1. <file> contains the raw terminal data stream 2. <file>.timing contains timing data for replaying using realistic output delays 3. <file>.info human-readable file containing additional terminal session information ● Replay transcripts with the scriptreplay program that is included in the util-linux package.
  • 57. Introduction to the Linux on System z Terminal Server over z/VM IUCV What can you do with the terminal server shell, called ts-shell? ■ ts-shell helps you to – Set up a terminal server to simplify system administration by providing a central access point – Authorize users to establish IUCV terminal connections to specific target systems – Improve auditing through creating transcripts of terminal sessions with target systems – Restrict users from getting access to the terminal server system ■ In a ts-shell session, you can – List your authorizations – Establish terminal connections 19 © 2010 IBM Corporation ts-shell commands: ● connect – Establish a terminal session ● list – List authorized target systems ● terminal – Display and set the default terminal ID ● help, version – Display help and version information ● exit, quit – Close terminal server shell session The ts-shell connect command uses iucvconn to establish terminal sessions. Thus, ts-shell can reuse iucvconn features like creating session transcripts and using escape characters.
  • 58. Introduction to the Linux on System z Terminal Server over z/VM IUCV How does ts-shell perform authorization checks? ■ Before ts-shell connects to a target system, ts-shell verifies that – The user is authorized for the specified target system – The target system is included in the global ts-shell authorization ■ ts-shell creates a transcript of a terminal session when – The target system is listed in the audit-systems configuration user ts-shell ts-shell ts-shell connect TGSYS verify user authorization verify global authorization start iucvconn ts-authorization.conf ts-systems.conf ts-audit-systems.conf unrestricted.conf 20 © 2010 IBM Corporation
  • 59. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you authorize users for ts-shell? 1.Creating a group and a user for ts-shell groupadd testgrp useradd -m -s /usr/bin/ts-shell -g ts-shell -G testgrp bob 2.Granting authorization to ts-shell users – Edit /etc/iucvterm/ts-authorization.conf @testgrp = list:linux006,linux007,linux008 bob = list:linux005 21 © 2010 IBM Corporation Configuring the ts-shell The ts-shell program reads its configuration from /etc/iucvterm/ts-shell.conf. The ts-shell.conf file contains settings that specify additional configuration files: ● /etc/iucvterm/unrestricted.conf – Restricting target system connections from ts-shell ● /etc/iucvterm/ts-authorization.conf – Granting authorizations to ts-shell users ● /etc/iucvterm/ts-audit-systems.conf – Configuring session transcripts Restricting target systems and configuring session transcripts Both configuration files list z/VM user IDs, each on a separate line. Granting authorizations to ts-shell users An authorization statement has the general form: <users> = <list_type>:<targets> <users> specifies who is authorized to establish connections. <users> can be an individual Linux user ID or a Linux user group. To distinguish users from groups, groups are prefixed with an at sign (@). <list_type>:<targets> specifies the target systems to which connections are authorized. Target systems can be specified as a comma-separated list (list:), in a list file (file:), or as a regular expression (regex:). Examples ● The following authorization statement permits user alice to connect to target systems LXGUEST1, LXGUEST3, LXGUEST5, LXGUEST7, and LXGUEST9. alice = list:lxguest1,lxguest3,lxguest5,lxguest7,lxguest9 ● The following authorization statement permits all users in group testgrp to connect to the target systems listed in a file /etc/iucvterm/auth/testsystems.list @testgrp = file:/etc/iucvterm/auth/test-systems.list. ● The following authorization statement permits user bob to connect to the target systems: LXGUEST0, LXGUEST2, LXGUEST4, LXGUEST6, and LXGUEST8. bob = regex:lxguest[02468]
  • 60. Introduction to the Linux on System z Terminal Server over z/VM IUCV How do you use ts-shell? Displaying authorizations and establishing terminal connections with ts-shell brueckh@cetus:~$ ssh bob@lnxts Click to add an outline Password: Last login: Fri Mar 5 12:01:32 2010 from dyn-9-152-212-21 Welcome to the Terminal Server shell. Type 'help' to get a list of available commands. bob@ts-shell> list linux006 linux007 bob@ts-shell> connect linux005 linux008 ts-shell: Connecting to linux005 (terminal identifier: lnxhvc0)... linux005 bob@ts-shell> Red Hat Enterprise Linux Server release 5.4 (Tikanga) Kernel 2.6.18-164.el5 on an s390x linux005 login: root Password: Last login: Fri Mar 5 12:02:45 on hvc0 [root@linux005 ~]# ps PID TTY TIME CMD 1678 hvc0 00:00:00 bash 1708 hvc0 00:00:00 ps [root@linux005 ~]# logout ts-shell: Connection ended 22 © 2010 IBM Corporation
  • 61. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you secure an IUCV terminal environment? 23 © 2010 IBM Corporation Notes You configure z/VM IUCV authorizations through the IUCV statement in the z/VM user directory. Depending on your needs and security policies you can use different strategies: ● Permit any IUCV connection to a target system: IUCV ALLOW ● Permit the terminal server to connect to specific z/VM guest virtual machines: IUCV LXGUEST1 IUCV LXGUEST2 ● Permit the terminal server to connect to any z/VM guest virtual machine: IUCV ANY You can restrict access to HVC terminal devices and iucvtty instances on target systems. ● The IUCV HVC device driver includes a z/VM user ID filter which specifies the z/VM user IDs that are allowed to connect. You can specify an initial filter setting through a kernel parameter. Later, you can list, change, or revoke the filter with the chiucvallow program. ● The iucvtty program allows you to specify a z/VM user ID filter on the command line. The IUCV terminal programs do not include support for distributed IUCV.
  • 62. Introduction to the Linux on System z Terminal Server over z/VM IUCV Conclusion ■ The terminal server using IUCV helps you to – Simplify system administration by providing a central access point – Heighten availability by providing emergency access to Linux instances – Work more comfortably by using full-screen terminals as alternative to traditional mainframe terminals 24 © 2010 IBM Corporation
  • 63. Introduction to the Linux on System z Terminal Server over z/VM IUCV Which Linux distributions include the terminal server using IUCV? ■ Red Hat – Red Hat Enterprise Linux 5 Update 4 or higher – Red Hat Enterprise Linux 6 ■ Novell – Novell SUSE Linux Enterprise Server 10 Service Pack 3 or higher – Novell SUSE Linux Enterprise Server 11 Service Pack 1 or higher ■ “Upstream” availability – Linux kernel 2.6.30 or higher – s390-tools 1.8.1 or higher 25 © 2010 IBM Corporation
  • 64. Introduction to the Linux on System z Terminal Server over z/VM IUCV Where do you get more information? ■ developerWorks – How to Set up a Terminal Server Environment (SC34-2596) – Device Drivers, Features, and Commands (SC33-8411) ■ s390-tools package – Man pages for iucvconn(1), iucvtty(1), ts-shell(1), af_iucv(7), and hvc_iucv(9) – ts-shell README 26 © 2010 IBM Corporation http://www.ibm.com/developerworks/linux/linux390/documentation_dev.html
  • 65. Introduction to the Linux on System z Terminal Server over z/VM IUCV Thank you! ■ Click to add an outline Any Questions? Hendrik Brückner IBM Deutschland Research & Development GmbH Linux on System z Development Schönaicher Strasse 220 71032 Böblingen, Germany Phone +49 7031 16-1073 brueckner@de.ibm.com 27 © 2010 IBM Corporation
  • 66. Introduction to the Linux on System z Terminal Server over z/VM IUCV Backup ■ Click to add an outline 28 © 2010 IBM Corporation
  • 67. Introduction to the Linux on System z Terminal Server over z/VM IUCV Click to add title THANK YOU! ■ Click to add an outline Your Linux on System z Requirements? Are you missing a certain feature, functionality, or tool? We'd love to hear from you! We will evaluate each request and (hopefully) develop the additional functionality you need. Send your input to brueckner@de.ibm.com 29 © 2010 IBM Corporation
  • 68. Introduction to the Linux on System z Terminal Server over z/VM IUCV What is iucvconn_on_login? ■ iucvconn_on_login is an alternative login shell for setting up a terminal server – Log in to Linux with a user ID that matches the z/VM user ID of the target system – After a successful login, a terminal session is established and the user is prompted to log in to the target system ■ Creating a user for iucvconn_on_login – useradd -m -s /usr/bin/iucvconn_on_login lxguest1 30 © 2010 IBM Corporation
  • 69. Introduction to the Linux on System z Terminal Server over z/VM IUCV What can you do if your terminal setup does not work? ■ What if there is no login prompt when you have connected to a HVC terminal? – Simply press the Return key to reactivate the getty program. ■ What if getty processes respawn too fast on HVC terminal devices? What if getty processes fail to open HVC terminal devices? – Check the setting of the hvc_iucv kernel parameter in your boot configuration. – Run zipl to write the modified boot configuration and reboot. – Check /etc/inittab or upstart job files to configure only activated HVC terminal devices. Alternatively, use ttyrun to prevent a respawn loop if a terminal is not operational. ■ What if the root user cannot log in on a HVC terminal device? – Check if the HVC terminal device is listed in the /etc/securetty file? 31 © 2010 IBM Corporation
  • 70. Introduction to the Linux on System z Terminal Server over z/VM IUCV How can you restrict access to HVC terminal devices? Authorizing HVC terminal connections with a z/VM user ID filter ■ The IUCV HVC device driver can accept IUCV connections only from specific terminal servers – Use the hvc_iucv_allow= kernel parameter to specify a comma-separated list of authorized z/VM user IDs ■ The chiucvallow command maintains the hvc_iucv_allow setting (filter) at runtime – Display the current z/VM user ID filter with lsiucvallow or chiucvallow -l – Clear the z/VM user ID filter with chiucvallow -c – Modify the current z/VM user ID filter with chiucvallow -e – Verify a z/VM user ID filter, which is saved in a file, with chiucvallow -V • You can also verify ts-shell authorization files that list z/VM user IDs 32 © 2010 IBM Corporation
  • 71. Introduction to the Linux on System z Terminal Server over z/VM IUCV How do you use the IUCV terminal programs? ■ Using the iucvconn program – To access the first z/VM IUCV HVC terminal on the Linux instance in z/VM guest LNXSYS02 $ iucvconn LNXSYS02 lnxhvc0 – To create a transcript of the terminal session to the Linux instance in z/VM guest LNXSYS99 $ iucvconn -s ~/transcripts/lnxsys99 LNXSYS99 lnxhvc0 ■ Using the iucvtty program – To allow remote logins using the terminal identifier “lnxterm” # iucvtty lnxterm – To access the “lnxterm” terminal on the Linux instance in z/VM guest LNXSYS01 $ iucvconn LNXSYS01 lnxterm – To use /sbin/sulogin instead of /bin/login for terminal identifier “suterm” # iucvtty suterm -- /sbin/sulogin 33 © 2010 IBM Corporation
  • 72. Introduction to the Linux on System z Terminal Server over z/VM IUCV How do you configure Linux instances to provide IUCV terminals? Examples using inittab ■ Creating new inittab entries for iucvtty instances t1:2345:respawn:/usr/bin/iucvtty lnxterm ■ Creating new inittab entries for IUCV HVC terminal devices – Using the traditional approach: h0:2345:respawn:/sbin/agetty -L 9600 hvc0 xterm – Using the ttyrun program: h1:2345:respawn:/sbin/ttyrun hvc1 /sbin/agetty -L 9600 %t xterm 34 © 2010 IBM Corporation Notes on ttyrun The ttyrun program is typically started during system initialization and is used to prevent respawn through the init(8) program when a terminal is not available.
  • 73. Introduction to the Linux on System z Terminal Server over z/VM IUCV How do you configure Linux instances to provide IUCV terminals? Examples using upstart job files ■ Creating a job file for iucvtty start on runlevel [12345] stop on runlevel [06] respawn exec /usr/bin/iucvtty lnxterm console none ■ Creating a job file for a HVC terminal device start on runlevel [12345] stop on runlevel [06] respawn normal exit 42 exec /sbin/ttyrun -e 42 hvc0 /sbin/mingetty %t 35 © 2010 IBM Corporation Notes on ttyrun The ttyrun program is typically started during system initialization and is used to prevent a respawn through the init(8) program when a terminal is not available.
  • 74. Introduction to the Linux on System z Terminal Server over z/VM IUCV Which Linux kernel components are involved? ■ Click to add an outline Other IUCV AF_IUCV back-ends back-end Hypervisor Console (HVC) IUCV base TTY device driver device driver TTY core layer Network core Kernel space User space /dev/hvc0 /dev/hvc1 socket() 36 © 2010 IBM Corporation
  • 75. Introduction to the Linux on System z Terminal Server over z/VM IUCV What does an IUCV terminal environment look like? Putting it all together 37 © 2010 IBM Corporation Target systems Linux instances on the same z/VM to which IUCV terminal connections are established. Terminal server A terminal server is a Linux instance that provides access to terminal devices on other Linux instances, called target systems. The terminal server and all target systems run as guest operating systems of the same z/VM instance. Terminal server and target systems are connected through the z/VM Inter- User Communication Vehicle (IUCV). From the terminal server, administrators can access terminal devices on target systems without requiring direct TCP/IP connections to the target systems.
  • 76. Introduction to the Linux on System z Terminal Server over z/VM IUCV What are Linux terminals and consoles? ■ Linux terminals – Input/output devices through which users interact with Linux and Linux applications – Terminals differ in their modes and capabilities ■ Linux consoles – Consoles are output devices which display Linux kernel messages – The preferred console • The preferred console is the device that displays messages during the boot process when the 'init' program is called ■ Linux terminal device drivers typically combine terminal and console devices 38 © 2010 IBM Corporation Terminal modes: ● Line-mode terminals: 3215 ● Block-mode terminals: 3270 ● „Full-screen mode“ terminals: allow advanced interactive capabilities Terminal capabilities: ● Specify terminal initialization sequences, screen positioning, colors, ... Terminal emulation: ● Today, separate physical terminals are rarities. ● Programs like xterm, kconsole, etc. emulate real terminals. ● The TERM environment variable specifies the set of terminal capabilities. The terminal capabilities are stored in „terminfo“ databases.