27.12.2012 Views

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

# cd /etc/init<br />

# vi control-alt-delete.conf<br />

# control-alt-delete - emergency keypress handling<br />

#<br />

# This task is run whenever the Control-Alt-Delete key combination is<br />

# pressed. Usually used to shut down the machine.<br />

start on control-alt-delete<br />

exec /sbin/shutdown -h now "Control-Alt-Delete pressed"<br />

This change will be picked up when the system is rebooted.<br />

8.2.6 Setting the system to logoff when Linux is shut down<br />

When Linux is shut down, the default is <strong>for</strong> the virtual machine to remain logged on even<br />

though it is not running an operating system. It is more convenient <strong>for</strong> the user ID to be<br />

logged off, both at z/<strong>VM</strong> SHUTDOWN time and <strong>for</strong> getting a refreshed 3270 emulator session. To<br />

do this, per<strong>for</strong>m the following steps:<br />

► Edit the file /etc/rc.d/rc.local and add two lines at the end as follows:<br />

# cd /etc/rc.d<br />

# vi rc.local<br />

#!/bin/sh<br />

#<br />

# This script will be executed *after* all the other init scripts.<br />

# You can put your own initialization stuff in here if you don't<br />

# want to do the full Sys V style init stuff.<br />

touch /var/lock/subsys/local<br />

chshut halt vmcmd logoff<br />

chshut poff vmcmd logoff<br />

<strong>The</strong> z/<strong>VM</strong> user ID should now be logged off when you halt or power off Linux.<br />

8.2.7 Configuring SSH keys<br />

Recall that you generated SSH keys on the cloner in 7.2.8, “Configuring SSH keys” on<br />

page 125. Now it is time to copy these keys from the cloner to the golden image.<br />

► Create a new directory (if one doesn’t already exist) on the golden image where the public<br />

key will be copied:<br />

# cd /root<br />

# mkdir .ssh<br />

► Set the permissions to 700 so that it can only be accessed by root:<br />

# chmod 700 .ssh<br />

► Copy the public key to the name authorized_keys using the secure copy command scp:<br />

# scp 9.60.18.223:/etc/ssh/ssh_host_dsa_key.pub /root/.ssh/authorized_keys<br />

<strong>The</strong> authenticity of host '9.60.18.223 (9.60.18.223)' can't be established.<br />

RSA key fingerprint is c7:d6:3b:8c:20:57:06:fc:8c:71:80:a5:4f:72:47:38.<br />

Are you sure you want to continue connecting (yes/no)? yes<br />

Warning: Permanently added '9.60.18.223' (RSA) to the list of known hosts.<br />

root@9.60.18.223's password:<br />

ssh_host_dsa_key.pub <strong>10</strong>0% 590 0.6KB/s 00:00<br />

Chapter 8. Installing and configuring the golden image 141

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!