This document describes how to transfer files in Connected Mobile Experiences (CMX) when you do not have the necessary permissions.
Cisco recommends that you have knowledge of:
Basic Unix commands
A File Transfer Protocol (FTP) browser application
The information in this document is based on CMX 10.4.1-4.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.
This document helps you understand permissions for files in CMX in order to change them and transfer them.
Sometimes when you try to transfer a file, you can run into a problem where the transfer is not successful. The cause is usually that you do not have the required permissions.
When you alter the permissions or ownership of a file, there is an inherent risk that some commands or features do not work as expected, this is why this document explains how to change permissions in the least intrusive way possible.
Step 1. Log in to CMX with your cmxadmin credentials.
Step 2. Locate the file you want to transfer from CMX.
In this document, the file /etc/libaudit.conf is used as an example.
[cmxadmin@localhost /]$ cd /etc/
Step 3. Check the permissions associated with that file. Use this command, replace libaudit.conf with the name of your file:
[cmxadmin@localhost etc]$ ls -la | grep libaudit.conf -rw-r-----. 1 root root 191 Jun 3 2014 libaudit.conf
For this particular file, you can notice that the permissions are -rw-r-----
The first character, in this case, a dash (-) means that it is a file. If it were a directory, the dash would be replaced by the character d.
The next 3 characters indicate the permissions for the owner of the file, rw-. This means the owner of libaudit.conf has read and write permissions.
The next 3 characters indicate the permissions for the group this file belongs to, r--. The group that owns libaudit.conf only has read permissions.
The next and final 3 characters indicate the permissions for any other users, ---. The rest of the users do not have read, write or execute permissions.
After the permissions, you can notice root root. The first root means user root is the owner of the file. The second root means the file belongs to group root.
With this information, it becomes clear that the user cmxadmin, which is not root nor belongs to group root, is not able to do anything with this file.
Step 4. Switch to user root in order to be able to modify the file's permissions.
[cmxadmin@localhost etc]$ su - Password: [root@localhost ~]#
Note: To switch back to the cmxadmin user, use the command su cmxadmin
Step 5. Navigate back to the file's path.
[root@localhost ~]# cd /etc/ [root@localhost etc]#
Step 6. Change the file's permission with the command chmod <###> <file>
To transfer the file, the only permission that is needed is the read (r) permission to other (o) users; similarly, o-r removes the read permission if you want to have the file in its original state once the transfer is complete.
Warning: Based on the relevance of the file that you want to modify, the wrong set of permissions can cause an unexpected behavior. Take note of what the original permissions are and ensure to have the correct integer for each user/group. Do not make unnecessary changes.
Note: If you want to transfer a file from your computer to CMX, you need to allow other users the write (w) permission at a minimum for the directory in which you intend to drop your file. This is because unlike the transfer of a file from CMX to the computer when you add a file to a directory you do modify it.
Step 7. Open your FTP application and connect to your CMX appliance.
Step 8. Transfer libaudit.conf from CMX to your PC. After the previous changes made to the file, the transfer must be successful.