Restarting Services in Solaris

To restart a service under solaris, run the scripts under

/lib/svc/method/

This is more or less equivalent to the startup scripts in /etc/init.d/ under linux.

For instance, to restart SSH, run:

/lib/svc/method/sshd restart

You may also want to take a look at svcadm. To restart SSH, you can run

svcadm restart ssh

or

svcadm restart svc:/network/ssh

How to create a linux user with an empty/blank password

I had a need to create a ‘guest’ account in one of my linux installs which allows anonymous users within a trusted intranet to login to a specially crafted script. One of the issues that I was faced with was with passwd refusing to accept a blank password. To let empty password logins, we must manually change the account password.

When we look at /etc/shadow, we will see something similar to:

username:$1$ADUODeAy$gRz7rO6P5lFcPpYwqd7Eb0:14929:0:99999:7:::

The underlined part is the password hash. The hash is delimited by $. Things to know:

  1. first $1 means the hash is a md5 hash
  2. second $ADUODeAy is the salt
  3. third $gRz7rO6P5lFcPpYwqd7Eb0 is the actual password hash

To generate this hash manually, we can use openssl:

# openssl passwd -1 -salt ADUODeAy
Password: [enter]
$1$ADUODeAy$eCJ1lPSxhSGmSvrmWxjLC1

Note that the first parameter, -1, tells openssl to use md5 to generate the hash. This is the same 1 from the original hash above.

Replace the existing hash in /etc/shadow with the hash generated by openssl. The account now essentially has an empty password.

Notes:

  • You will need to temporarily change the permission of /etc/shadow in order to write to it.
  • You will need to enable ‘PermitEmptyPasswords’ in /etc/ssh/sshd_config for empty password logins to work
  • This can easily be a security risk to your machine! Ensure the account and server is locked down or use SSH keys for passwordless logins! Remember, by default, users can SSH tunnel through this guest account. You must consider the implications of enabling such an account on your machine.

XEN Windows Server install causes “stop: 0x0000005d”

When attempting to install Windows Server 2008 R2 under XEN, after loading from the disc, the installer will blue screen with the error:

STOP: 0x0000005D (<4 hex values, last 3 being 0x0000000000000000>)

To resolve this, try to enable pae in your XEN configuration file. ie, add the following line:

pae = 1

I am currently using the following configuration under XEN 3.12. Hopefully this will help.

kernel = '/usr/lib/xen/boot/hvmloader'
builder = 'hvm'
device_model = '/usr/lib64/xen/bin/qemu-dm'
maxmem = 4096
memory = 1024
vcpus=1
pae = 1
acpi=1
apic=1

name = "xenwin"

vif = [ 'type=ioemu' ]

disk = [ 'phy:/dev/VolGroup00/winserv08r2_disk,ioemu:hda,w',
         'file:/vm/iso/win2008server-r2.iso,ioemu:hdc:cdrom,r' ]

# Boot from the CD 
boot='d'

vnc=1
vncconsole=1
vncpasswd=''
sdl=0

stdvga=0 
serial='pty'
ne2000 = '0'
usbdevice='tablet'

on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'