Applies To:

Show Versions Show Versions

sol8465: Viewing and extracting the contents of an encrypted UCS archive file
How-ToHow-To

Original Publication Date: 03/09/2008
Updated Date: 03/28/2013

To view or extract the contents of an encrypted UCS archive file, you must first decrypt the encrypted UCS archive file into a new decrypted archive file by performing the following procedure:

After performing the Decrypt an encrypted UCS archive file into a decrypted archive file procedure, you can view or extract the contents of the encrypted UCS archive file by performing one of the following three procedures:

Decrypting an encrypted UCS archive file into a decrypted archive file

  1. Log in to the command line.
  2. Create a new directory within the /var/tmp directory, using the following command syntax:

    mkdir /var/tmp/<directory>

    Replace <directory> with a name of your choice.
  3. Copy the encrypted UCS archive into the new directory, using the following command syntax:

    cp <filename> /var/tmp/<directory>/

    Replace <filename> with the name of the encrypted UCS archive from which you want to view files, and replace <directory> with the name of the directory that you created in Step 2.
  4. Change directories to the new directory, using the following command syntax:

    cd /var/tmp/<directory>

    Replace <directory> with the name of the directory that you created in Step 2.
  5. Decrypt the encrypted UCS archive file into a new decrypted archive file, by typing the following command:

    /usr/bin/gpg <UCS_filename>

    Replace <UCS_filename> with the name of the encrypted UCS archive file.
  6. The following Enter passphrase prompt displays.

    gpg: AES encrypted data:
    Enter passphrase:
     
  7. Type the passphrase for the encrypted UCS archive file.
  8. A prompt that appears similar to the following example displays, to enter the new filename for the decrypted archive file:

    gpg: /var/local/ucs/filename.ucs: unknown suffix
    Enter new filename [configsync-2.0-1-Linux-2.4.219.3.0.178.0.im]:

     
  9. Type the filename for the decrypted archive file.

    Important: Do not give this file a .ucs file extension, as this file is not a decrypted UCS archive file, and cannot be installed as a UCS archive file.

Viewing the contents of a decrypted archive

  1. Log in to the command line.
  2. Use the following command syntax, replacing <filename> with the name of the decrypted archive file:

    tar -ztf <filename>

    This command provides a list of all the files included in the decrypted archive file.

Extracting files from the decrypted archive

You can extract the files from the decrypted archive without overwriting your existing configuration, by performing one of the following procedures:

  • Extracting all files
  • Extracting a single file

Important: Extracted files will be placed in the current directory. To avoid overwriting your existing configuration, your current directory should be the /var/tmp/ that you created in Step 2 of the Decrypt an encrypted UCS archive file into a new decrypted archive file procedure.

Extracting all files

  1. Log in to the command line.
  2. Use the following command syntax, replacing <filename> with the name of the decrypted archive file:

    tar -zxf <filename>


    This command extracts the files and places them into the current directory. Additionally, this command creates subdirectories to match the directories in which the configuration files are normally stored. For example, this command creates a config directory for the files that are normally contained in the /config directory.

Extracting a single file

  1. Log in to the command line.
  2. Use the following command syntax, replacing <filename> with the name of the decrypted archive file, and replacing <file-to-extract> with the relative path and name of the file that you want to extract from the decrypted archive file:

    tar -zxf <filename> <file-to-extract>

    For example, to retrieve the bigip.conf file, you must specify the config directory, but not the root directory, so you would type the following command:

    tar -zxf decrypted_archive config/bigip.conf

    This command extracts the file and places it in the current directory. It creates a subdirectory to match the directory in which the configuration file is normally stored. For example, if you extract config/bigip.conf, it creates a config directory.

Viewing the contents of a file contained in a decrypted archive file

  1. Log in to the command line.
  2. Use the following command syntax, replacing <filename> with the name of the decrypted archive file, and replacing <file-to-view> with the relative path and name of the file that you want to view from the decrypted archive file:

    Note
    : The third character in the flags list is a capital letter O.


    tar -zxOf <filename> <file-to-view>

    For example, you would type the following command to view the bigip.conf file:

    tar -zxOf decrypted_archive config/bigip.conf

Note: You can use wildcards to display multiple files from an archive. For example, config/bigip.*.

Important: Some files contained in a UCS archive are binary files, which do not display correctly.

Supplemental Information

Was this resource helpful in solving your issue?




NOTE: Please do not provide personal information.



Incorrect answer. Please try again: Please enter the words to the right: Please enter the numbers you hear:

Additional Comments (optional)