First steps in Solaris 10

Although I already have some experience with Linux (Debian, Red Hat), the first steps with my brand new Solaris 10 installation turned out to be a little bit harder than expected. This was due to the minimalistic shell (SH) and problems while installing the SSH server. So here are my notes for those trying to get into Solaris. The first part includes the steps necessary to install the BASH shell. In the second part, installation of the SSH daemon is shown.


Setup: Solaris 10 Update 9, No remote services enabled, POSIX C locale, Core System Installation

Mount Solaris Installation CD

Login as root on the local console, then mount the Solaris installation CD:

# mkdir /mnt/cdrom
# mount -F hsfs /dev/dsk/c0t0d0s0 /mnt/cdrom

Note: The path to your CD-ROM drive depends on your hardware configuration, use “ls /dev/dsk” to list possible paths.

Install BASH package

To install the BASH package (SUNWbash), change into the Solaris_10 folder on the CD and use pkgadd to install the package. Then start the shell by simply typing “bash”.

# cd /mnt/cdrom/Solaris_10
# pkgadd -d Product/ SUNWbash
[..]
# bash
bash-3.00#

Optional: Edit .bashrc

“bash-3.00” looks a bit unusual to me. To get a prompt similar to a Linux system, create the .bashrc file in your home directory:

bash-3.00# cd
bash-3.00# vi .bashrc

Insert the following line in the new file:

PS1='\u@\h:\w\$ '

Restart BASH by typing “exit” and starting BASH again. The result should look something like this:

root@unknown:/mnt/cdrom#

Install SSH

Lets check which packages we have:

# ls /mnt/cdrom/Solaris_10/Product | grep ssh

Install all packages with the following commands:

# pkgadd -d /mnt/cdrom/Solaris_10/Product/ SUNWsshcu
# pkgadd -d /mnt/cdrom/Solaris_10/Product/ SUNWsshdr
# pkgadd -d /mnt/cdrom/Solaris_10/Product/ SUNWsshdu
# pkgadd -d /mnt/cdrom/Solaris_10/Product/ SUNWsshr
# pkgadd -d /mnt/cdrom/Solaris_10/Product/ SUNWsshu

In a previous attempt to install the SSH server when the locale is set to POSIX C, I had some issues with the codeset:

[..] Cannot convert the local codeset strings to UTF-8 [..]

The solution is to install an additional package named SUNWuiu8:

# pkgadd -d /mnt/cdrom/Solaris_10/ProductProduct/ SUNWuiu8

As soon as we installed all necessary packages for our SSH server, lets create new keys:

# /lib/svc/method/sshd -c

Then, enable the SSH service with svcadm and verify the daemon is running:

# svcadm enable ssh
# svcs -a | grep ssh

Optional: Allow root login

When you want to allow the root user to log in via SSH, change the setting in your sshd_config accordingly. Note that this is not a good idea on productive systems and you should generally avoid working with the root user.

# vi /etc/ssh/sshd_config
PermitRootLogin yes
# svcadm restart ssh

Congratulations! Now you can start working on your Solaris machine and explore your new system.

Optional: Add a new user

# groupadd krenger
# useradd -c "simon" -d /export/home/simon -g krenger -m -s /bin/bash simon
# passwd simon

Optional: Change hostname

If you did not specify the hostname during installation (Solaris only seems to ask you when you specify a static IP address), your system will still be named “unknown”. I found an excellent guide on how to change your Solaris 10 hostname here.

Hello world

My name is Simon Krenger, I am a Technical Account Manager (TAM) at Red Hat. I advise our customers in using Kubernetes, Containers, Linux and Open Source.

Elsewhere

  1. GitHub
  2. LinkedIn
  3. GitLab