Installing and Configuring OpenStack (Juno) in Oracle® Solaris

Exit Print View

Updated: June 2016
 
 

How to Add Users to the VM Instance

In Oracle Solaris, the VM instance uses the Oracle Solaris zones technology to enable you to provision virtual machines in the cloud. To add users to the VM instance, you need to issue commands as a zone administrator. The steps are not supported in the dashboard. Therefore, you need to access a terminal window.

Before You Begin

Obtain the external network floating IP address to which the VM instance is associated by clicking the dashboard's Admin > System > Instances tab.

  1. On a terminal window, list the VM instances.
    # zoneadm list -cv

    Names of VMs in the cloud have the prefix instance.

  2. Log in to the specific zone.
    # zlogin zonename
  3. Create a home directory for the user.
    root@zone# mkdir -p /export/home/username
  4. Create the user.
    root@zone# useradd -d home-dir options

    where home-dir is the directory you created for the user. For other options that you can use with the useradd command, see the useradd(1M) man page.

  5. To create the user password, issue this command and then follow the prompts.
    root@zone# passwd username
  6. (Optional) Verify that the password is created.
    root@zone# grep username /etc/passwd
  7. To create the root password, issue this command and then follow the prompts.
    zone# passwd root
  8. Exit the zone and then log out.
  9. Log in with Secure Shell to the virtual machine.
    # ssh username@floating-IP

    where floating-IP is the VM's associated floating IP address.

Example 4  Adding a User to a VM Instance

In this example, username jsmith is added as a user of VM1.

# zoneadm list -cv
 ID NAME              STATUS     PATH                            BRAND    IP
  0 global            running    /                               solaris  shared
  6 instance-00000006 running    /system/zones/instance-00000006 solaris  excl
  - myzone            installed  /system/zones/myzone            solaris  excl

# zlogin instance-00000006
[Connected to zone 'instance-00000006' pts/3]
Last login: Wed Jan  6 14:31:18 2016 on pts/2
Oracle Corporation      SunOS 5.11      11.3    September 2015

root@VM1# mkdir -p /export/home/jsmith
root@VM1# useradd -d /export/home/jsmith -m -s /usr/bin/bash jsmith 

User jsmith is created with bash as the default shell.

root@VM1# passwd jsmith
New Password: password
Re-enter new Password: password
passwd: password successfully changed for jsmith

root@VM1# passwd root
New Password: password
Re-enter new Password: password
passwd: password successfully changed for root

root@VM1# exit
logout

[Connection to zone 'instance-00000006' pts/3 closed]

# ssh jsmith@10.132.10.9