diff --git a/include/ibm/management_console_rest.hpp b/include/ibm/management_console_rest.hpp
index 5e49a9a..d5ee590 100644
--- a/include/ibm/management_console_rest.hpp
+++ b/include/ibm/management_console_rest.hpp
@@ -42,47 +42,6 @@
 constexpr size_t maxBroadcastMsgSize =
     1000; // Allow Broadcast message size upto 1KB
 
-inline bool
-    createSaveAreaPath(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    // The path /var/lib/obmc will be created by initrdscripts
-    // Create the directories for the save-area files, when we get
-    // first file upload request
-    std::error_code ec;
-    if (!std::filesystem::is_directory("/var/lib/obmc/bmc-console-mgmt", ec))
-    {
-        std::filesystem::create_directory("/var/lib/obmc/bmc-console-mgmt", ec);
-    }
-    if (ec)
-    {
-        asyncResp->res.result(
-            boost::beast::http::status::internal_server_error);
-        asyncResp->res.jsonValue["Description"] = internalServerError;
-        BMCWEB_LOG_DEBUG
-            << "handleIbmPost: Failed to prepare save-area directory. ec : "
-            << ec;
-        return false;
-    }
-
-    if (!std::filesystem::is_directory(
-            "/var/lib/obmc/bmc-console-mgmt/save-area", ec))
-    {
-        std::filesystem::create_directory(
-            "/var/lib/obmc/bmc-console-mgmt/save-area", ec);
-    }
-    if (ec)
-    {
-        asyncResp->res.result(
-            boost::beast::http::status::internal_server_error);
-        asyncResp->res.jsonValue["Description"] = internalServerError;
-        BMCWEB_LOG_DEBUG
-            << "handleIbmPost: Failed to prepare save-area directory. ec : "
-            << ec;
-        return false;
-    }
-    return true;
-}
-
 inline void handleFilePut(const crow::Request& req,
                           const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                           const std::string& fileID)
@@ -101,7 +60,9 @@
 
     BMCWEB_LOG_DEBUG
         << "handleIbmPut: Request to create/update the save-area file";
-    if (!createSaveAreaPath(asyncResp))
+    std::string_view path =
+        "/var/lib/bmcweb/ibm-management-console/configfiles";
+    if (!crow::ibm_utils::createDirectory(path))
     {
         asyncResp->res.result(boost::beast::http::status::not_found);
         asyncResp->res.jsonValue["Description"] = resourceNotFoundMsg;
@@ -109,7 +70,8 @@
     }
 
     std::ofstream file;
-    std::filesystem::path loc("/var/lib/obmc/bmc-console-mgmt/save-area");
+    std::filesystem::path loc(
+        "/var/lib/bmcweb/ibm-management-console/configfiles");
 
     // Get the current size of the savearea directory
     std::filesystem::recursive_directory_iterator iter(loc, ec);
@@ -234,6 +196,12 @@
     }
 
     file.open(loc, std::ofstream::out);
+
+    // set the permission of the file to 600
+    std::filesystem::perms permission = std::filesystem::perms::owner_write |
+                                        std::filesystem::perms::owner_read;
+    std::filesystem::permissions(loc, permission);
+
     if (file.fail())
     {
         BMCWEB_LOG_DEBUG << "Error while opening the file for writing";
@@ -244,6 +212,7 @@
         return;
     }
     file << data;
+
     std::string origin = "/ibm/v1/Host/ConfigFiles/" + fileID;
     // Push an event
     if (fileExists)
@@ -268,7 +237,8 @@
     handleConfigFileList(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
 {
     std::vector<std::string> pathObjList;
-    std::filesystem::path loc("/var/lib/obmc/bmc-console-mgmt/save-area");
+    std::filesystem::path loc(
+        "/var/lib/bmcweb/ibm-management-console/configfiles");
     if (std::filesystem::exists(loc) && std::filesystem::is_directory(loc))
     {
         for (const auto& file : std::filesystem::directory_iterator(loc))
@@ -296,7 +266,8 @@
 {
     std::vector<std::string> pathObjList;
     std::error_code ec;
-    std::filesystem::path loc("/var/lib/obmc/bmc-console-mgmt/save-area");
+    std::filesystem::path loc(
+        "/var/lib/bmcweb/ibm-management-console/configfiles");
     if (std::filesystem::exists(loc) && std::filesystem::is_directory(loc))
     {
         std::filesystem::remove_all(loc, ec);
@@ -334,8 +305,8 @@
                           const std::string& fileID)
 {
     BMCWEB_LOG_DEBUG << "HandleGet on SaveArea files on path: " << fileID;
-    std::filesystem::path loc("/var/lib/obmc/bmc-console-mgmt/save-area/" +
-                              fileID);
+    std::filesystem::path loc(
+        "/var/lib/bmcweb/ibm-management-console/configfiles/" + fileID);
     if (!std::filesystem::exists(loc))
     {
         BMCWEB_LOG_ERROR << loc << "Not found";
@@ -367,7 +338,8 @@
     handleFileDelete(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                      const std::string& fileID)
 {
-    std::string filePath("/var/lib/obmc/bmc-console-mgmt/save-area/" + fileID);
+    std::string filePath("/var/lib/bmcweb/ibm-management-console/configfiles/" +
+                         fileID);
     BMCWEB_LOG_DEBUG << "Removing the file : " << filePath << "\n";
     std::ifstream fileOpen(filePath.c_str());
     if (static_cast<bool>(fileOpen))
