unix

Solaris – Zones, In the Beginning

Uso Solaris da quasi un anno ma non mi sono mai cimentato nell’uso delle famose Zones riassumendo i poche parole giusto per capire di cosa si parla dico: “operating system level virtualization”

bash-3.00# zonecfg -z Z01
Z01: No such zone configured
Use ‘create’ to begin configuring a new zone.
zonecfg:Z01> create -b
zonecfg:Z01> set zonepath=/zones/Z01
zonecfg:Z01> exit
bash-3.00# zoneadm -z Z01 install
Preparing to install zone <Z01>.
Creating list of files to copy from the global zone.
Copying <115072> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <792> packages on the zone.
Initialized <792> packages on zone.
Zone <Z01> is initialized.
The file </zones/Z01/root/var/sadm/system/logs/install_log> contains a log of the zone installation.
bash-3.00#
bash-3.00# zonecfg -z Z01
zonecfg:Z01> add net
zonecfg:Z01> set address=10.0.0.1
zonecfg:Z01> set physical=hme0
zonecfg:Z01> end
zonecfg:Z01> verify
zonecfg:Z01> commit
zonecfg:Z01> exit

bash-3.00# zoneadm -z Z01 boot

bash-3.00# zlogin -C Z01

SSH key

Nel caso succeda che il demone sshd non parta per i seguenti motivi:

Could not load host key: /etc/ssh/ssh_host_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Disabling protocol version 1. Could not load host key
Disabling protocol version 2. Could not load host key

Con questi comandi si generano le chiavi host:

ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key