Managing your cloud resources with OpenStack: Difference between revisions

Remove content from Working with Linux VMs now that this is on a new page.
m (capitalization)
(Remove content from Working with Linux VMs now that this is on a new page.)
Line 56: Line 56:
An example of a CIDR rule is <code>192.168.1.1/24</code>. This looks just like a normal IP address with a <code>/24</code> appended to it. IP addresses are made up of 4, 1-byte (8 bits) numbers ranging from 0 to 255. What this <code>/24</code> means is that this CIDR rule will match the first left most 24 bits (3 bytes) of an IP address. In this case, any IP address starting with <code>192.168.1</code> will match this CIDR rule. If <code>/32</code> is appended, the full 32 bits of the IP address must match exactly; if <code>/0</code> is appended, no bits must match and therefore any IP address will match it.
An example of a CIDR rule is <code>192.168.1.1/24</code>. This looks just like a normal IP address with a <code>/24</code> appended to it. IP addresses are made up of 4, 1-byte (8 bits) numbers ranging from 0 to 255. What this <code>/24</code> means is that this CIDR rule will match the first left most 24 bits (3 bytes) of an IP address. In this case, any IP address starting with <code>192.168.1</code> will match this CIDR rule. If <code>/32</code> is appended, the full 32 bits of the IP address must match exactly; if <code>/0</code> is appended, no bits must match and therefore any IP address will match it.


=Linux VM User Management= <!--T:28-->
=Working with CloudInit=
There are a number of ways to allow more than one person to log into a VM. We recommend creating new user accounts and adding public [[SSH Keys]] to these accounts.


==Creating an account and keys== <!--T:29-->
You can customize your instance after it has launched using CloudInit. This can be done via the OpenStack Command Line Interface or the Dashboard when launching an instance under the "Configuration" tab of the "Launch Instance" pop-up screen. You can paste your CloudInit script into the "Customization Script" field.  
A new user account can be created on Ubuntu with the command {{Command|sudo adduser --disabled-password USERNAME}} To be able to connect, the new user will need to have a key pair, see [[Generating_SSH_keys_in_Windows|generating SSH keys in windows]] or [[Using_SSH_keys_in_Linux#Creating a Key Pair|creating a key pair in Linux or Mac]] depending on the operating system they will be connecting from. Then their public key must be added to <code>/home/USERNAME/.ssh/authorized_keys</code> on the VM, ensuring permissions and ownership are correct as described in steps 2 and 3 of [[Using_SSH_keys_in_Linux#Connecting using a Key Pair|connecting using a key pair]].
 
==Granting admin privileges== <!--T:44-->
In Ubuntu administrative, or root user privleges, can be given to a new user with the command
{{Command|sudo visudo -f /etc/sudoers.d/90-cloud-init-users}}
which opens an editor where a line like
USERNAME ALL=(ALL) NOPASSWD:ALL
can be added. For more detailed information about the visudo command and how to edit this file see this [https://www.digitalocean.com/community/tutorials/how-to-edit-the-sudoers-file-on-ubuntu-and-centos#what-is-visudo digitalocean] tutorial on the topic.


==Add users with CloudInit during VM creation== <!--T:30-->
==Add users with CloudInit during VM creation== <!--T:30-->
cc_staff
147

edits