Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Workaround for PDF export bug

...

  • When typing text, press <ESC> once finished. In case you’re blocked, press also <ESC> before executing commands described below
  • both editors use case sensitive commands
RequestCommand

To quit without saving

Press ‘:’ then enter ‘q!’

To quit with saving

Press ‘:’ then enter ‘x’ or ‘wq’

Go to  top of file

Press ‘:’ then enter ‘0’

Go to last line

Press ‘G’

Search pattern

Press ‘/’ then enter your search text. Press then ‘n’ for next (forward) or ‘N’ for backward

Remove current character

Press ‘x’

Insert text

Press ‘i’ (press ESC once text completed)

Insert line

Press ‘o’ for a line below cursor, ‘O’ for a line above cursor (press ESC once text completed)

Delete a line

Press ‘dd’

(info) 'vim' has also a graphical version named 'gvim'. If not installed, you can run: # yum -y install gvim

‘gedit’ graphical editor

‘gedit’ is a graphical text editor, users familiar with Windows notepad should not encounter difficulties to use it.

RequestCommand

To quit

close the window by clicking on the cross top right corner

Save file

Press <CTRL-S>


Div
classpagebreak

‘nano’ text editor

‘nano’ is a basic text editor, very simple to use and displaying available commands at the bottom of the screen. For example, to leave ‘nano’ , use ^X (press CTRL + X)

How to setup ‘ssh’ trusts between Linux and

...

titleNotes

HP-UX

Please note:

  • The prompts will tell you where to execute the commands, "

...

  • HPUX#" (root user) or "Linux#"  (root user)
  • Remember Linux/Unix is case sensitive
  • If hosts are not known by each other, fill the /etc/hosts file for example (using vi for example)
  • linuxhost represents the name of your

...

  • Charon server (can be any name you want)

...

  • hpuxhost represents the hostname of your

...

  • HP-UX virtual machine
  • Generate the key


...

On the HP-UX system, enter the following commands if the folder does not already exist:

HPUX# mkdir /.ssh
HPUX# chmod 600 /.ssh

On the Linux server, enter:

Linux# ssh-keygen -t rsa

→  Do not specify a any passphrase.

Linux# ssh-keygen -e -f cd /root/.ssh
Linux# chmod 600 id_rsa*
Linux# scp id_rsa.pub > linuxhost hpuxhost:/.ssh/linuxhost_rsa.pub

...

Tru64# cd /.ssh2
Tru64# echo "Key linuxhost.pub" >> authorization

  • Initialize the first ssh connection (answer 'yes' to confirm)

...

Linux# ssh tru64host date

then retry the same command to verify the trust is working.

(lightbulb) If an error occurs, you can check and clean the /root/.ssh/known_host file on the Linux host

How to setup ‘ssh’ trusts between Linux and VMS

...

titleNotes

→ Enter the password for the copy operation to complete

On the HP-UX system, add the Linux server key to the authorized keys:

HPUX# cd /.ssh
HPUX# cat linuxhost_rsa.pub >>authorized_keys
HPUX# chmod 600 authorized_keys

Perform a simple test on the Linux server:

Linux# ssh hpuxhost hostname
hpuxhost

(question) If trying to execute a remote command on the HP-UX system, a message telling "no matching cipher found" is displayed, the cipher has to be setup on the Linux server side in the /root/.ssh/config file:

Linux# cat /root/.ssh/config

Host hpuxhost
  Hostname hpuxhost
  KexAlgorithms +diffie-hellman-group1-sha1
  HostKeyAlgorithms +ssh-rsa
  Ciphers +3des-cbc


Div
classpagebreak


How to install 'rsh' on RHEL 8

To setup 'rsh' on RHEL8, use the following commands:

# dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
ARCH=$( /bin/arch )
subscription-manager repos --enable "codeready-builder-for-rhel-8-${ARCH}-rpms"
dnf -y install rsh

(info) More information in this article: rsh and rsh-server packages missing in RHEL 8

How to setup ‘rsh’ trusts between Linux and HP-UX

Please note:

  • The prompts will tell you where to execute the commands, "

...

  • HPUX#" (

...

  • root user) or "Linux#"  (root user)
  • Remember Linux/Unix is case sensitive

...

  • If hosts are not known by each other, fill the /etc/hosts file for example

...

VMS$ SET DEF SYS$LOGIN
VMS$ @TCPIP$CONFIG

...

...
* Create a new default server host key? YES: YES
     Creating private key file: TCPIP$SSH_DEVICE:TCPIP$SSH.SSH2]HOSTKEY
     Creating public key file: TCPIP$SSH_DEVICE:TCPIP$SSH.SSH2]HOSTKEY.PUB
...

...

Linux# ssh-keygen -t rsa

→ Do not specify a passphrase
Linux# ssh-keygen -e -f /root/.ssh/id_rsa.pub > /root/.ssh/linuxserver.pub

  • Copy the generated file /root/.ssh/linuxserver.pub (or use copy/paste between putty session for example) to the VMS system in the SYS$SYSROOT:[SYSMGR.SSH2] directory
    (lightbulb) If this folder does not exist, create it using the following command: $ CREATE /DIRECTORY SYS$SYSROOT:[SYSMGR.SSH2]
  • On the VMS system add the Linux server key to the authorized keys:

    VMS$ SET DEF SYS$SYSLOGIN
    VMS$ SET DEF SYS$SYSROOT:[.SSH2]
    VMS$ OPEN/WRITE TMP AUTHORIZATION.

    (warning) If the file already exists, use /APPEND instead of /WRITE
    VMS$ WRITE TMP "KEY LINUXSERVER.PUB"
    VMS$ CLOSE TMP

    (warning) Do not forget the dot at the end of the authorization file name

    Perform some tests (examples)
    (info) Charon server name "charon", vms system name "pluto":
    charon# ssh system@pluto "show system /noproc"
    OpenVMS V7.3-2 on node PLUTO 27-SEP-2013 11:50:14.37 Uptime 0 19:20:07(using vi for example)
  • linuxhost represents the name of your Charon server (can be any name you want)
  • hpuxhost represents the hostname of your HP-UX virtual machine

Introduction

RSH executes commands on a remote host. It can be used to issue a shutdown on the Charon Tru64 virtual machine.

Pre-requisites

The RSH method requires the 'rsh' package. It can be installed using the following command:

Linux# yum install rsh

Notes

On the HP-UX system issuing the shutdown, create a proxy between the root user of the Charon server and the user.

Example:

HPUX# echo "linuxhost root" >>~/.rhosts

If the Charon server name is not known to the TCPIP database, edit the /etc/hosts file and add the server ip address and its name.

Ensure manual commands can be passed to the HP-UX system from the Charon server.

Example:

Linux# rsh linuxhost date

If a "poll: protocol failure in circuit setup" is returned, the firewall settings have to be set to open ports 1011 to 1023.

Please always refer to your network administrator when changing the firewall rules, commands below are given as example only.

Example:

# firewall-cmd --permanent --new-service=Charon
# firewall-cmd --permanent --service=Charon --add-port=1011-1023/tcp
# firewall-cmd --get-active-zones
public
interfaces: ens34 ens35
# firewall-cmd --zone=public --permanent --add-service=Charon
# firewall-cmd --reload


Div
classpagebreak


Shutdown guests with Expect tool

Introduction

In case SSH cannot nor RSH can not be used to perform clean shutdown of the guests, the "expect" tool can be used to connect to the console, perform the login operation and execute the shutdown command depending on the console status (at login prompt, shell prompt or SRM prompt).

The operations performed during the "expect" script execution are detailed in the VM management - Create/Edit guest stop script chapter.

(warning) In this case the password is sent without encryption.

To facilitate use of "expect" for shutdown, an example is provided in the "guest_shutdown.exp" script located in the /opt/charon/utils folder. If you plan to customize the script, you'll have to create a copy and not use it directly as it will be overwritten in case of Toolkit upgrade.

Please note:

'telnet' and 'expect' packages must be installed in order to use this feature.

The following error message can be returned when stopping the virtual machine when trying to use the expect script example:

  • if expect package is not installed: "Stop script returned error code 126".
  • if telnet is not installed: "%EXPECT-F-NOSRM, Cannot continue, 'telnet' is not installed" then "Stop script returned error code 4"

Caution: the virtual machine process will be however killed by service management process

...

.


If console is locked:

Any active session to the console must be killed before the "expect" script is executed.

(info) For example, if you are connected via "telnet" on the localhost/port (the kill is not done inside the expect script).

...

Using the "/opt/charon/utils/charon_gstart

...

_expect" script file the necessary operations will be performed.

(warning) If the console is locked from another host (if you use putty for example), you will have to cancel the connection by yourself otherwise the shutdown will not be performed cleanly.

...

This script can handle the following situations:

...

  • Expect: "Username: " (VMS) or "login: " (Tru64)
  • Action: An interactive session will be initiated based on <user> and <password> provided in the parameters

...

...


...

  • Expect: ‘>>>’ (so works with VAX and Alpha with "P00>>>")
  • Action: A 'power off' command will be issued. If the command is not recognized, the F6 key will be sent (this must be enabled within the configuration file). If the F6 key did not stop the emulator, the script will exit with error code 9 meaning you will have to kill the emulator process yourself (see examples in the "/opt/charon/utils/charon_gstart.stop.example" file)
Div
classpagebreak


Script usage

...

# path/script <port> <user> <password> <prompt> <opsys>


Parameters:

ParameterDescription
<port>telnet port number (example: 1000330001)
<user>username for login (must be able to perform shutdown)
<password>password
<prompt>shell prompt (including end space) or last characters of the prompt
<opsys>VMS or UNIXHPUX or MPEIX (case sensitive)


Example for HP-UX:

Image Removed

(info) Examples are given in the

# /opt/charon/utils/guest_shutdown.exp 30001 root 12345 "# " HPUX

Example for MPEIX:

# /opt/charon/utils/

...

guest_

...

shutdown.exp 30001 X X X MPEIX

How to restart CHARON-

...

PAR on Linux automatically on failure

(warning) This part only applies to Linux distributions using systemd thus Red Hat Enterprise Linux 6.x versions are not concerned.

...

Automatic restart on failure is managed by systemd at Linux level, please refer to systemd man pages.

For example, edit the service configuration file and add the following parameters

...

:


ParameterTypeDescription
RestarttextConfigures whether the service shall be restarted when the service process exits, is killed, or a timeout is reached
RestartSecnumericConfigures the time to sleep before restarting a service (as configured with Restart=). Takes a unit-less value in seconds, or a time span value such as "5min 20s". Defaults to 100ms.
StartLimitIntervalnumericConfigure service start rate limiting. By default, services which are started more than 5 times within 10 seconds are not permitted to start any more times until the 10 second interval ends. With these two options, this rate limiting may be modified. Use StartLimitInterval= to configure the checking interval (defaults to DefaultStartLimitInterval= in manager configuration file, set to 0 to disable any kind of rate limiting). Use StartLimitBurst= to configure how many starts per interval are allowed (defaults to DefaultStartLimitBurst= in manager configuration file).
StartLimitBurstnumeric


Include Page
KBCOMMON:DOC-GoToToc
KBCOMMON:DOC-GoToToc