Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp305954lqj; Wed, 10 Apr 2024 10:56:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUolRR5aPgbogHV5wAr02Z+tcjuKeb8wN6A/+YKDO6coLgp3ULpVsHnNJ6mc9chYSJXHHNVlLu5m6UTaPUqGwHILa+XBrM/5vbDTY4Mmg== X-Google-Smtp-Source: AGHT+IGYH+lLqYqQod9S8uG7HEGlZtZtJDLQUmRYZo/25OhpqVJmq1UoFfkKJhvqRaOZhMxUNr2m X-Received: by 2002:a05:6a20:e188:b0:1a7:69d9:8f45 with SMTP id ks8-20020a056a20e18800b001a769d98f45mr641592pzb.5.1712771793147; Wed, 10 Apr 2024 10:56:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712771793; cv=pass; d=google.com; s=arc-20160816; b=UB3jdgqttWDyG3OlVXCMhsH/W2lbM1lKdtT+KWqlQtgnHWd5uyWO9+0Smg4mFsrlR/ R2Cm2oGENGLYj+2DjZcKkz3EV9+pImyRduPs7ClQJd7Fo1RPLJZHgaCvhcn/WyItWmYC 6qSqUYtWAT9QPQwb734i++Oi9ApL26YO0YIppj9pizL/KmTg74DZBltHIlrlTSFdIzJZ fbJ+IhgmpA6OjON2acog9Zi+CJH1BjYMe8KKHjc3ilvv9tXy/RuEMjh84s5C7KEEEm8y +ltqQ4/hVJVxihPaPdYHUsQSmP5+hG0NLYiueF8acUzujJZUEAPn2/2n792DSk+jHvoR 7t1A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+1scWUYOt8vy5e2arWgxlPTQFk0XeU00oR5LERfll4w=; fh=QFcgJGgnsSD/BV0GctLFAbit3MMqSoxndIEaNXkQ4DQ=; b=RAasm8vdJbD+NrjxnzGIIEVywT+Z9OscnB0LbIsOjy5DwntxISJ7nBiwFgNwDH6quq +pYBfEZ1ofR71wGaMLOIfb0w9b9uK/k5zzPsCZOcxOGB1miSs8+AskjkCP+BoP1O4+3C qrtIxHCJsnD2XBYbqKWeuWt7h+q4og+tDTf/xJlswXokKyqRRFj9/gZYW0fL1fcFcrCd Gb1tdjSkZPkGFbyfJyf3kS6fv3TE1wLRNEm9S7q+4QldWiHFlPMrDagrX+UpojBTb5ZU Fkd1TUCQZzKHTysS62bOmlW5irxvGwq+RWgr7QsbH6Ifz4FLMWXnFuuSFh8N0uhcup31 Hq6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bXszPOJF; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-2751-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2751-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d4-20020a63d644000000b005dc4ec6cd2esi11035867pgj.767.2024.04.10.10.56.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 10:56:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2751-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bXszPOJF; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-2751-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2751-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E55B9287864 for ; Wed, 10 Apr 2024 17:55:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C720817F375; Wed, 10 Apr 2024 17:55:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bXszPOJF" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1F8B168DC for ; Wed, 10 Apr 2024 17:55:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712771728; cv=none; b=Ahy+kPOt0vERqNe9p5KVELfS49kWF/IMDo2/jJItDbVy1OM1jbuMx3TPTS5dW6Ev3sp+byr0yp7aTmog5tzq1ZQiskvXPXemaXaA9Em7zCV9vZjLfuUlfrzQRnrWS20E1XI0p39fQHe/gwPbIGFlz0ZtUeNh6PfrBgyG+hGModc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712771728; c=relaxed/simple; bh=GokhNY9u/aeNi03VjCug/C81HFqSrTZ+DEYqOKcTkQM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oHsW7RaFAlDEyUxr4FJpZ/hZRZe7W4Im6MjClQDadmM4KjOwtCzJq6zS2Jmu8dm/EZXuETes719A5U9JgcJFYrHFSbtLlxnpqqdd+Xm+YqHkwCgT/pff/rT+IGrcJVRyok308a7TH5KdTuL5N6ikpbE8CBOvlcnQKjFa6Zehwxc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=bXszPOJF; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712771725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+1scWUYOt8vy5e2arWgxlPTQFk0XeU00oR5LERfll4w=; b=bXszPOJFo6YdAeofXCqAQ136ANZ2hfJ0F3x/F41L8I4JinGfGwElSJ+FJFr3Qe191Q8KgL QmEd7ujbcliBPjI8E4MegLOCwYdJbo/V/OI8YNc7gliW9lLzFm0u7rELnujyATX0jx8e+W ljFS13QlW/s0mNHaAFfCAtW1J8KuoHM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-658-s9Nga816PkSMqCMgy_NWlw-1; Wed, 10 Apr 2024 13:55:24 -0400 X-MC-Unique: s9Nga816PkSMqCMgy_NWlw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1B9D0180A1F6; Wed, 10 Apr 2024 17:55:24 +0000 (UTC) Received: from [192.168.37.1] (ovpn-0-15.rdu2.redhat.com [10.22.0.15]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A21A110E4B; Wed, 10 Apr 2024 17:55:23 +0000 (UTC) From: Benjamin Coddington To: =?utf-8?q?Z=C3=A9_Geraldo?= Cc: linux-nfs@vger.kernel.org Subject: Re: Configuring NFS with UID/GID Offset (sec=sys approach) Date: Wed, 10 Apr 2024 13:55:22 -0400 Message-ID: <64DB2D25-5A33-434B-8898-7683ADCE3C92@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 On 9 Apr 2024, at 16:50, Zé Geraldo wrote: > Hello, > > I'm seeking advice on configuring NFS to handle a specific scenario > where the server and client have an offset in their UID/GID values. On > the server, a UID/GID translates to a UID/GID + 10000 on the client > side. > > Ideally, I'd like to avoid modifying server configurations or changing > client UIDs at this time. > > My current approach involves utilizing the sec=sys option with an > offset to bridge this UID/GID gap. However, I'm unsure about the > effectiveness of this method and would appreciate any insights from > the community about how I could do this. > > Here's a summary of the situation: > > Problem: Server and client have a UID/GID offset (server UID/GID = > client UID/GID + 10000) > Goal: Configure NFS to handle this offset without server config > changes or client UID modifications. > Possible Solution (under consideration): Using sec=sys with an offset > in the mount options. > > While alternative configurations like sec=krb5 functioned in a test > environment, modifying the server configuration is not preferred. > > If anyone has experience with similar scenarios or can offer guidance > on using sec=sys with offsets for NFS, your expertise would be greatly > appreciated. > > Thanks, > > José Geraldo Hi José, Have you looked into whether user namespaces on top of NFS can solve your problem? I haven't specifically used them on NFS, but it might be an existing tool you can build upon. When you set them up, you can specify a mapping; see user_namespaces(7). A more in-depth explanation of how they work is here: https://docs.kernel.org/filesystems/idmappings.html#general-notes You must know that sec=sys doesn't provide real security, though. As long as a particular NFS client has sec=sys access to a server, processes on that client can impersonate any UID/GID. Ben