There are many posts on Internet teaching you how to get root access on CUCM. This is not a secret. Since CUCM is Linux-based, the method is pretty straight forward - use a Linux boot CD to boot into rescue mode and modify the relevant files. Here's a simple walk through.
Assuming CUCM was already installed. Boot the box with a Linux installation CD (e.g. RedHat). Type "linux rescue" in the boot prompt.
Choose keyboard. Default is 'US':
We don't need to set up network. Thus choose 'No' here.
Choose "Continue" to mount the CUCM file system.
The following message is telling you that the CUCM file system has been mounted under /mnt/sysimage. If you want to map the root directory to the CUCM file system (which is recommended), you may use command "chroot /mnt/sysimage".
Below are the commands and explanations.
chroot /mnt/sysimage
This is to map the root directory to CUCM file system.
cd /etc
Change the working directory to /etc, where most of the system configuration files are stored.
rm securetty
Remove file "securetty" to allow remote connections with root.
passwd root
Reset (change) password for the root user. Type a password that is easy for you to remember. Retype it to confirm. If the password was changed successfully, you'll see the prompt "passwd: all authentication token updated successfully".
Notes:
- If you typed a simple password, you might get a warning like "BAD PASSWORD: it is based on a dictionary word". Just ignore it and retype to confirm.
- There's no screen display for the password you're typing. Type carefully.
The following steps require some basic knowledge of the vi editor. If you're not familiar with vi, please search Internet for vi commands help.
vi passwd
Change the passwd file so the root user has a shell (command line interpreter) to use. Use vi commands. Change the line
To Save and exit file.
For those who are not familiar with vi, here are the command sequence (case-sensitive):
- Type /s to search for character 's'
- Type D to delete to the end of line
- Type A to enter append mode
- Type bin/bash to set the shell
- Press ESC key (it's a key on the upper-left corner of your keyboard) to exit append mode
- Type :wq to save and exit file.
vi ssh/sshd_config
Change the sshd_config file so you can SSH as root (it's disabled by default). Use vi commands. Change the line
To
For those who are not familiar with vi, here are the command sequence (case-sensitive):
- Type /Per to search for the word begins with 'Per'
- Type X to delete the letter on the left (which is '#' in this case)
- Type :wq! to save and exit this read-only file
Back to command prompt and type exit command twice to reboot the system.
Use a SSH client (such as putty) to test. You should be able to SSH into CUCM with root account.
This method applies to all Linux-based appliances such as Unity Connection, CUPS, CER, UCCX (Linux version), etc.
P.S. If the active partition is /PartB, you might run into an error like this:
Just hit "Enter" key to get to the shell. Then use the following commands:
mount --bind /dev /mnt/sysimage/dev
chroot /mnt/sysimage
===================================================
Updated 3/13/2015:
I got many comments that "this works on CUCM version xx but didn't work on version yy".
Please understand that CUCM is just an application running on top of the RedHat Linux (which Cisco uses for many of its "appliances").
The rooting process is more OS related than application related. If it didn't work, there could be only two reasons:
1) Some steps were missed or weren't done right (most likely).
or
2) RedHat changed how the authentication works between versions (very unlikely).
In a nutshell, the rooting is not specific to CUCM. It's not even specific to Cisco. You may root any appliance that is based on a common OS (such as Linux).
Last but not the least, this still works on my CUCM 10.5. :)
Sometimes this might be /mnt/sysimage/partB !
ReplyDeleteIt doesn't work on CUCM 8.6, seems that Cisco guys are developing new security methods :) hahaa
ReplyDeleteWorked on my CUCM 8.6.2. :)
ReplyDeleteCool tip Michael. Thanks!
ReplyDeleteHi, i tired to do on cucm 8.6.1 and don't work. After i reboot was disabled all account and can't log anymore.
ReplyDeleteCan you help , i tired to do http://forum.ru-board.com/postings.cgi?action=edit&forum=35&topic=3849&postno=2607 ,
but the same, after reboot disable all account.
I just tried this on a 8.6.2 system and it would appear that the moment you change shadow, the system can no longer read it once CUCM attempts to boot. I get a unix_chkpwd error could not get username from shadow (root)
ReplyDeleteThis procedure is not specific to CUCM. This is a generic password recovery procedure for Linux. If you couldn't get it work, just search Internet for "Linux", "root", "password", "recovery".
ReplyDeleteI am trying to add a new user because customer does't want administrator user name that was giving at installation time (security issue). I have create a new user but I don't know how to map the Platform command line interface developp by Cisco at login time. Any idea ?
ReplyDeleteTake a look at https://www.cisco.com/en/US/docs/voice_ip_comm/cucm/cli_ref/8_6_1/cli_ref_861.html#wp39889
DeleteI can not create with the set account name a user equivalent as the master administrator one which is created at installation time so I can delete the original master one.
DeleteI thought creating that kind of user with a linux rescue session but when I log into it, the platform command interface (cisco) is not starting and it does appear in the show account displayed. Cisco TAC answer me that we have to reinstall specifying a new admin user and recover from drs backup. I was trying a faster way since we have 20 servers.
Not sure what you tried to do. Is this all about cosmetic? What kind of privilege is missing with the "set account" command?
DeleteAnyway, you may reference the existing account settings in the passwd file to clone a new one (groups, shell, etc.)
i can't boot with redhat iso file, so i use vmware v.8 and try find a way to boot with redhat
ReplyDeleteAn easier way to get root access for a fresh install is to add an empty file named ENABLE_ROOT_ACCESS in the base_scripts directory. After this, use mkisofs to create a bootable iso.
ReplyDeleteHi Michael,
ReplyDeleteThis worked for me on UCONN 8.6.2.21900-5. took the license and everything was good...until i rebooted the system. Now all my services in cli show STARTING.
On CUCM the same thing happens and I get a Database communication error.
Any ideas. I've tried restoring my snapshots and try again but same thing keeps happening. Am i misssing something?
neshpatel
What about CUCM 9.1 is it the same procedure?
ReplyDeleteSame procedure.
DeleteDon't you need to create an account before you to all this ?
ReplyDeleteits not taking rm securetty
ReplyDeleteFor those without access to a RHEL 5 (or similar) ISO. I just did this on CUCM with a CentOS 5 ISO as well.
ReplyDeleteHi,
ReplyDeleteJust tried to do this on CUCM v10.5 ...didn't work, "unknown login" when using the root ID.
Tried it on a couple of servers with same results ...although V9 works OK
Does anybody know how to get root access to Version 10
Tried it on CUCCX 9.0(2)SU1 and it works! I mounted the rhel-server-6.0-x86_64-boot.iso image, which propose the PartB active partition: just click OK and continue and the corrections are made for you.
ReplyDeleteGreat article!
David
FWIW it works with CUCM 11.5
ReplyDeleteSadly this will be my last post. I just installed UCCX 12.5, and they have finally changed over to a cloud based model. Thats the end of an era. Thank you very much for this original post. I've been referring back to it for at least a half dozen years.
ReplyDeleteI haven't been to this page in a while, i am surprised this has worked for the latest versions, I stopped at V7.1
ReplyDeleteI dont know the latest post. I tried to deploy it on the uccx but got an error "no such directory /mnt/sysimage exists
ReplyDelete