diff --git a/docs/en_US/images/preferences_browser_display.png b/docs/en_US/images/preferences_browser_display.png
index 9dd41765fd3a4c1fdb4303308969139b91008359..c35649697ee57e69a4624b48f74e301b507cf5c9 100644
GIT binary patch
diff --git a/docs/en_US/images/server_general.png b/docs/en_US/images/server_general.png
index 57129ef7bf6e92b0186cbc9f9e659b94711b5362..8904b7d378830e20f10f1f0a737b18e3f5eae406 100644
GIT binary patch
diff --git a/docs/en_US/preferences.rst b/docs/en_US/preferences.rst
index 40b9030ad..6e2de85f9 100644
--- a/docs/en_US/preferences.rst
+++ b/docs/en_US/preferences.rst
@@ -49,7 +49,7 @@ Use the fields on the *Display* panel to specify general display preferences:
   the client will display the animated dialogues/notifications otherwise it
   will be unanimated.
 
-* When the *Hide shared server?* switch is set to *True*, the client will hide
+* When the *Hide shared servers?* switch is set to *True*, the client will hide
   all the shared servers from the browser tree.
 
 * Use the *Lock layout* field to lock the UI layout at different levels. This
diff --git a/docs/en_US/server_dialog.rst b/docs/en_US/server_dialog.rst
index a43e3b0d0..e9c010f0b 100644
--- a/docs/en_US/server_dialog.rst
+++ b/docs/en_US/server_dialog.rst
@@ -30,7 +30,7 @@ Use the fields in the *General* tab to identify the server:
 * If the *Connect now?* checkbox is checked, the client will attempt a
   connection to the server upon completion of the dialog; this is the default
 
-* If the *Shared with all?* switch is moved to *Yes* then that server can be
+* If the *Shared?* switch is moved to *Yes* then that server can be
   shared with all the other users. This option is available only to admin users. For more information on users see :ref:`User Management Dialog <user_management>`. The users can access the shared servers with some restritctions. The Users accessing the shared servers cannot do the following operations on the shared servers:
 
     * Create a server
diff --git a/web/pgadmin/browser/register_browser_preferences.py b/web/pgadmin/browser/register_browser_preferences.py
index 215421cbf..e261a32e0 100644
--- a/web/pgadmin/browser/register_browser_preferences.py
+++ b/web/pgadmin/browser/register_browser_preferences.py
@@ -27,10 +27,11 @@ def register_browser_preferences(self):
     if config.SERVER_MODE:
         self.hide_shared_server = self.preference.register(
             'display', 'hide_shared_server',
-            gettext("Hide shared server?"), 'boolean', False,
+            gettext("Hide shared servers?"), 'boolean', False,
             category_label=gettext('Display'),
             help_str=gettext(
-                'If set to true, then all shared server will be hidden'
+                'If set to True, then all shared servers will be '
+                'hidden from browser tree'
             )
         )
 
diff --git a/web/pgadmin/browser/server_groups/servers/__init__.py b/web/pgadmin/browser/server_groups/servers/__init__.py
index af845e531..f22e2e6d9 100644
--- a/web/pgadmin/browser/server_groups/servers/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/__init__.py
@@ -139,13 +139,16 @@ class ServerModule(sg.ServerGroupPluginModule):
         Return shared server properties
         :param server:
         :param sharedserver:
-        :return:
+        :return: shared server
         """
-
         server.bgcolor = sharedserver.bgcolor
         server.fgcolor = sharedserver.fgcolor
         server.name = sharedserver.name
         server.role = sharedserver.role
+        server.use_ssh_tunnel = sharedserver.use_ssh_tunnel
+        server.tunnel_host = sharedserver.tunnel_host
+        server.tunnel_port = sharedserver.tunnel_port
+        server.tunnel_authentication = sharedserver.tunnel_authentication
         server.tunnel_username = sharedserver.tunnel_username
         server.tunnel_password = sharedserver.tunnel_password
         server.save_password = sharedserver.save_password
@@ -157,45 +160,53 @@ class ServerModule(sg.ServerGroupPluginModule):
 
         return server
 
-    @staticmethod
-    def check_to_hide_shared_server(hide_shared_server, shared_server,
-                                    auto_detected_server):
+    def get_servers(self, all_servers, hide_shared_server, gid):
+        """
+        This function creates list of servers which needs to display
+        in browser tree
+        :param all_servers:
+        :param hide_shared_server:
+        :param gid:
+        :return: list of servers
+        """
+        servers = []
+        for server in all_servers:
+            if server.discovery_id and \
+                not server.shared and \
+                config.SERVER_MODE and \
+                len(SharedServer.query.filter_by(
+                    user_id=current_user.id,
+                    name=server.name).all()) > 0 and not hide_shared_server:
+                continue
 
-        hide_server = False
-        if hide_shared_server or \
-                shared_server.name == auto_detected_server:
-            hide_server = True
+            if server.shared and server.user_id != current_user.id:
+
+                shared_server = self.get_shared_server(server, gid)
+
+                if hide_shared_server:
+                    # Don't include shared server if hide shared server is
+                    # set to true.
+                    continue
+
+                server = self.get_shared_server_properties(server,
+                                                           shared_server)
+            servers.append(server)
 
-        return hide_server
+        return servers
 
     @login_required
     def get_nodes(self, gid):
         """Return a JSON document listing the server groups for the user"""
 
         hide_shared_server = get_preferences()
-
         servers = Server.query.filter(
             or_(Server.user_id == current_user.id, Server.shared),
             Server.servergroup_id == gid)
 
         driver = get_driver(PG_DEFAULT_DRIVER)
+        servers = self.get_servers(servers, hide_shared_server, gid)
 
         for server in servers:
-
-            if server.shared and server.user_id != current_user.id:
-
-                shared_server, auto_detected_server = \
-                    self.get_shared_server(server, gid)
-
-                if self.check_to_hide_shared_server(hide_shared_server,
-                                                    shared_server,
-                                                    auto_detected_server):
-                    # Don't include shared server if hide shared server is
-                    # set to true
-                    continue
-
-                server = self.get_shared_server_properties(server,
-                                                           shared_server)
             connected = False
             manager = None
             errmsg = None
@@ -323,6 +334,7 @@ class ServerModule(sg.ServerGroupPluginModule):
 
         shared_server = None
         try:
+            db.session.rollback()
             user = User.query.filter_by(id=data.user_id).first()
             shared_server = SharedServer(
                 user_id=current_user.id,
@@ -346,13 +358,13 @@ class ServerModule(sg.ServerGroupPluginModule):
                 fgcolor=data.fgcolor if data.fgcolor else None,
                 service=data.service if data.service else None,
                 connect_timeout=0,
-                use_ssh_tunnel=0,
-                tunnel_host=None,
+                use_ssh_tunnel=data.use_ssh_tunnel,
+                tunnel_host=data.tunnel_host,
                 tunnel_port=22,
                 tunnel_username=None,
                 tunnel_authentication=0,
                 tunnel_identity_file=None,
-                shared=data.shared if data.shared else None
+                shared=True
             )
             db.session.add(shared_server)
             db.session.commit()
@@ -372,12 +384,9 @@ class ServerModule(sg.ServerGroupPluginModule):
         :param gid:
         :return: shared_server
         """
-        auto_detected_server = None
         shared_server = SharedServer.query.filter_by(
             name=server.name, user_id=current_user.id,
             servergroup_id=gid).first()
-        if server.discovery_id:
-            auto_detected_server = server.name
 
         if shared_server is None:
             ServerModule.create_shared_server(server, gid)
@@ -386,7 +395,7 @@ class ServerModule(sg.ServerGroupPluginModule):
                 name=server.name, user_id=current_user.id,
                 servergroup_id=gid).first()
 
-        return shared_server, auto_detected_server
+        return shared_server
 
 
 class ServerMenuItem(MenuItem):
@@ -494,8 +503,7 @@ class ServerNode(PGChildNodeView):
 
         for server in servers:
             if server.shared and server.user_id != current_user.id:
-                shared_server, auto_detected_server = \
-                    ServerModule.get_shared_server(server, gid)
+                shared_server = ServerModule.get_shared_server(server, gid)
                 server = \
                     ServerModule.get_shared_server_properties(server,
                                                               shared_server)
@@ -552,8 +560,7 @@ class ServerNode(PGChildNodeView):
         server = Server.query.filter_by(id=sid).first()
 
         if server.shared and server.user_id != current_user.id:
-            shared_server, auto_detected_server = \
-                ServerModule.get_shared_server(server, gid)
+            shared_server = ServerModule.get_shared_server(server, gid)
             server = ServerModule.get_shared_server_properties(server,
                                                                shared_server)
 
@@ -677,8 +684,7 @@ class ServerNode(PGChildNodeView):
 
         if config.SERVER_MODE and server.shared and \
                 server.user_id != current_user.id:
-            sharedserver, auto_detected_server = \
-                ServerModule.get_shared_server(server, gid)
+            sharedserver = ServerModule.get_shared_server(server, gid)
 
         # Not all parameters can be modified, while the server is connected
         config_param_map = {
@@ -781,6 +787,8 @@ class ServerNode(PGChildNodeView):
                 True,
                 self.node_type,
                 connected=connected,
+                shared=server.shared,
+                user_id=server.user_id,
                 user=manager.user_info if connected else None,
                 server_type='pg'  # default server type
             )
@@ -849,8 +857,7 @@ class ServerNode(PGChildNodeView):
 
         for server in servers:
             if server.shared and server.user_id != current_user.id:
-                shared_server, auto_detected_server = \
-                    ServerModule.get_shared_server(server, gid)
+                shared_server = ServerModule.get_shared_server(server, gid)
                 server = \
                     ServerModule.get_shared_server_properties(server,
                                                               shared_server)
@@ -907,10 +914,8 @@ class ServerNode(PGChildNodeView):
         conn = manager.connection()
         connected = conn.connected()
 
-        # if server.shared and not current_user.has_role("Administrator"):
         if server.shared and server.user_id != current_user.id:
-            shared_server, auto_detected_server = \
-                ServerModule.get_shared_server(server, gid)
+            shared_server = ServerModule.get_shared_server(server, gid)
             server = ServerModule.get_shared_server_properties(server,
                                                                shared_server)
             server_owner = server.server_owner
@@ -1136,6 +1141,7 @@ class ServerNode(PGChildNodeView):
                     self.node_type,
                     user=user,
                     connected=connected,
+                    shared=server.shared,
                     server_type=manager.server_type
                     if manager and manager.server_type
                     else 'pg',
@@ -1265,8 +1271,7 @@ class ServerNode(PGChildNodeView):
         server = Server.query.filter_by(id=sid).first()
         shared_server = None
         if server.shared and server.user_id != current_user.id:
-            shared_server, auto_detected_server = \
-                ServerModule.get_shared_server(server, gid)
+            shared_server = ServerModule.get_shared_server(server, gid)
             server = ServerModule.get_shared_server_properties(server,
                                                                shared_server)
         if server is None:
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js
index be737da4e..a26dfc5c9 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/server.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js
@@ -269,7 +269,10 @@ define('pgadmin.node.server', [
                 gettext('Are you sure you want to disconnect the server %s?', d.label),
                 function() { disconnect(); },
                 function() { return true;}
-              );
+              ).set('labels', {
+                ok: gettext('Ok'),
+                cancel: gettext('Cancel'),
+              });
             } else {
               disconnect();
             }
@@ -752,6 +755,11 @@ define('pgadmin.node.server', [
         },
         schema: [{
           id: 'id', label: gettext('ID'), type: 'int', mode: ['properties'],
+          visible: function(model){
+            if (model.attributes.user_id != current_user.id && pgAdmin.server_mode == 'True')
+              return false;
+            return true;
+          },
         },{
           id: 'name', label: gettext('Name'), type: 'text',
           mode: ['properties', 'edit', 'create'], disabled: 'isShared',
@@ -759,7 +767,7 @@ define('pgadmin.node.server', [
         {
           id: 'gid', label: gettext('Server group'), type: 'int',
           control: 'node-list-by-id', node: 'server_group',
-          mode: ['create', 'edit'], select2: {allowClear: false}, visible: 'isVisible',
+          mode: ['create', 'edit'], select2: {allowClear: false}, disabled: 'isShared',
         },
         {
           id: 'server_owner', label: gettext('Shared Server Owner'), type: 'text', mode: ['properties'],
@@ -795,7 +803,7 @@ define('pgadmin.node.server', [
           id: 'connect_now', controlLabel: gettext('Connect now?'), type: 'checkbox',
           group: null, mode: ['create'],
         },{
-          id: 'shared', label: gettext('Shared with all?'), type: 'switch',
+          id: 'shared', label: gettext('Shared?'), type: 'switch',
           mode: ['properties', 'create', 'edit'], 'options': {'size': 'mini'},
           readonly: function(model){
             var serverOwner = model.attributes.user_id;
diff --git a/web/pgadmin/browser/server_groups/servers/tests/servers_test_data.json b/web/pgadmin/browser/server_groups/servers/tests/servers_test_data.json
index 117a2982b..855fba055 100644
--- a/web/pgadmin/browser/server_groups/servers/tests/servers_test_data.json
+++ b/web/pgadmin/browser/server_groups/servers/tests/servers_test_data.json
@@ -346,7 +346,7 @@
       "mock_data": {
       },
       "expected_data": {
-        "status_code": 500
+        "status_code": 200
       }
     },
     {
