Create the cvbackupadmin user with limited capabilities or commands needed to administer the nodes and cluster. This user's capabilities will be limited to the set of commands supported by the restricted shell.
Procedure
-
Login to any one of the nodes in the cluster.
-
Navigate the following folder:
# cd /opt/commvault/MediaAgent/
-
Run the script to enable restricted shell using one of the following options:
-
Enable the restricted shell from the cluster level, with a single password for the cvbackupadmin user in all the nodes in the cluster:
# ./cv_setup_restricted_shell.py cluster_level
-
Enable the restricted shell from the node level, with a unique password for the cvbackupadmin user in each node:
# ./cv_setup_restricted_shell.py node_level
-
View the help for the command:
]# ./cv_setup_restricted_shell.py -h usage: cv_setup_restricted_shell.py [-h] {cluster_level,node_level} ... cv_setup_restricted_shell.py creates cvbackupadmin user with restricted shell access. positional arguments: {cluster_level,node_level} cluster_level Creates cvbackupadmin user with restricted shell access on all nodes in the cluster. node_level Creates cvbackupadmin user with restricted shell access on current node. optional arguments: -h, --help show this help message and exit
Output similar to the following will be displayed:
Setting up Passwordless SSH on this HS1.5 setup. SSH Host keys will be regenerated during settingup of Passwordless SSH. Do you want proceed(y/n):
-
-
Type Y and press <Enter> to continue.
Output similar to the following will be displayed:
INFO: regenerating ssh host keys on node [mynode001] INFO: regenerating ssh host keys on node [mynode002] INFO: regenerating ssh host keys on node [mynode003] INFO: Executing command [rm -f /etc/ssh/ssh_host_*_key*] INFO: Executing command [rm -f /root/.ssh/known_hosts] INFO: Executing command [ssh-keygen -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key] Generating public/private ecdsa key pair. Your identification has been saved in /etc/ssh/ssh_host_ecdsa_key. Your public key has been saved in /etc/ssh/ssh_host_ecdsa_key.pub. The key fingerprint is: SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxx root@mynode3 ... INFO: Executing command [ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key] Generating public/private rsa key pair. Your identification has been saved in /etc/ssh/ssh_host_rsa_key. Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub. The key fingerprint is: SHA256:yyyyyyyyyyyyyyyyyyyyyy+ng root@mynode002 The key's randomart image is: ... INFO: Executing command [systemctl restart sshd.service] /usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.24.3) or chardet (3.0.4) doesn't match a supported version! RequestsDependencyWarning) Detected a HyperScale cluster containing the following nodes: [mynode3,mynode002,mynode1,]-[UID: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz] Do not proceed if all nodes are not listed in the cluster. Proceed (n):
-
Type Y and press <Enter> to continue.
The following prompt will be displayed:
Do all nodes use the same [root] password (y):
-
Type Y and press <Enter> if all the nodes use the same root password.
Type N and press <Enter> if the nodes have separate root passwords.
The following prompt will be displayed: (This prompt will be repeated for each node, if you typed N in the above prompt.)
Please enter password for user [root] (None):
-
Enter the root password and then press <Enter> to continue.
Output similar to the following will be displayed:
INFO : Configuring passwordless ssh between [mynode002] and [mynode002] for user [root]. INFO : Successfully configured passwordless ssh from [mynode002] -> [mynode002]. INFO : Configuring passwordless ssh between [mynode002] and [mynode001]] for user [root]. INFO : Configuring passwordless ssh between [mynode002] and [mynode002] for user [root]. INFO : Successfully configured passwordless ssh from [mynode002] -> [mynode002]. INFO : Configuring passwordless ssh between [mynode002] and [mynode003]] for user [root]. ... INFO : Successfully setup Passwordless SSH on this HS1.5 setup. INFO : Creation of User [cvbackupadmin] and setting of Password is done only once per node. Requirements for Password are: 1: Length of password should be atleast 8 characters. 2: Password should contain atleast one lowercase alphabet [a-z]. 3: Password should contain atleast one uppercase alphabet [A-Z]. 4: Password should contain atleast one digit [0-9]. 5: Password should contain atleast one non alpha-numeric character from [~!@#?$%]. Password for [cvbackupadmin]: Confirm Password for [cvbackupadmin]:
-
Type the password, and re-type to confirm the password for the cvbackupadmin user.
Output similar to the following will be displayed:
INFO : List of Nodes on which Restricted shell will be installed and associated with cvbackupadmin user: mynode002.company.com mynode003.company.com mynode001.company.com INFO : Setting up restricted shell on [node: mynode002.company.com] INFO : Setting up restricted shell on [node: mynode003.company.com] INFO : Setting up restricted shell on [node: mynode004.company.com] INFO : Installing restricted shell INFO : Successfully installed restricted shell INFO : Checking if user [cvbackupadmin] already exists INFO : Creating backup admin user [cvbackupadmin] INFO : Successfully created backup admin user [cvbackupadmin] INFO : Setting up restricted environment for user [cvbackupadmin] INFO : Completed setting up of restricted environment for user [cvbackupadmin] INFO : Adding commands accessible to user [cvbackupadmin] INFO : Adding command: clear INFO : Adding command: osupdate INFO : Adding command: enable_ransomware_protection INFO : Adding command: hs_node INFO : Adding command: hs_cluster INFO : Adding command: noop INFO : Completed adding commands accessible to user [cvbackupadmin] INFO : Successfully set up restricted shell on all nodes in the cluster
The creation sequence is logged in /var/log/commvault/Log_Files/cv_setup_restricted_shell.log.
Result
The cvbackupadmin user will be created with the following capabilities:
Command |
Description / Additional Options |
---|---|
clear |
Command to clear the restricted shell screen. |
hs_node |
Command to administer the local node from where its is invoked, unless a remote node name is specified. The following options are available for this command: |
|
|
hs_cluster |
Command to administer all the nodes in a cluster. The following options are available for this command: |
|
|
enable_ransomware_protection |
Command to enable ransomware protection on the nodes. Reboot the node after enabling ransomware using the following command:
|
osupdate |
Command to upgrade the operating system (OS). When the OS upgrade process in in progress, the upgrade status can be viewed using the following command:
|
What to Do Next
Disable root access on the nodes, so that only the restricted user (cvbackupadmin) will be able to login and access the nodes in the cluster.