简体   繁体   English

我可以给我的团队一个限制访问的 ssh linux 存储库的私钥吗?

[英]Can I give my team a private key for an ssh linux repository that limits access?

I have a linux repository in my school that allows me to access my own root.我在学校有一个 linux 存储库,它允许我访问自己的根目录。 Could I give my team a private key that only allows them to R/W on certain folders in my own directory?我可以给我的团队一个私钥,只允许他们读/写我自己目录中的某些文件夹吗?

For instance I would have two folders like so: path/to/folder1 & path/to/folder2.例如,我会有两个这样的文件夹:path/to/folder1 & path/to/folder2。

Could I specify a specific private key to only having access to those two folders and nothing else?我可以指定一个特定的私钥来只访问这两个文件夹吗? In any other folder, an attempt to R/W would result in (access denied).在任何其他文件夹中,尝试 R/W 将导致(访问被拒绝)。 They would be logging in as me, but the private key would default to this limited access.他们将以我的身份登录,但私钥将默认为此受限访问。

Edit: Even better.编辑:更好。 All I really want them to be able to do is git merge main .我真正希望他们能够做的就是git merge main That's it.就是这样。 I want them to be able to be inside of my root, and do the command git merge main.我希望它们能够在我的根目录中,并执行命令 git merge main。 Only access I want them to have.只有我希望他们拥有的访问权限。

Yes.是的。 You can use the command parameter in your authorized_keys file for that.为此,您可以在authorized_keys文件中使用command参数。 See AUTHORIZED_KEYS FILE FORMAT in https://man7.org/linux/man-pages/man8/sshd.8.html :请参阅https://man7.org/linux/man-pages/man8/sshd.8.html中的 AUTHORIZED_KEYS 文件格式:

command="command"

Specifies that the command is executed whenever this key is used for authentication.指定只要使用此密钥进行身份验证就执行该命令。 The command supplied by the user (if any) is ignored.忽略用户提供的命令(如果有)。 ... This option might be useful to restrict certain public keys to perform just a specific operation. ...此选项可能有助于限制某些公钥仅执行特定操作。 An example might be a key that permits remote backups but nothing else.一个示例可能是允许远程备份但仅此而已的密钥。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我可以使用任何私钥对我的服务器执行 ssh ? - Why I can do ssh to my server using any private key? Subversion over ssh - 从Windows主机访问Linux上的远程存储库 - Subversion over ssh - access to the remote repository on Linux from Windows host 我无法使用公钥和私钥从 Jenkins 节点通过 SSH 连接到远程服务器 - I can't able to SSH into remote server from Jenkins node using public and private Key 关闭PuTTY SSH会话后,如何运行仍在运行的Linux命令? - How can I run a Linux command that still runs after I close my PuTTY SSH session? 向ssh代理添加私钥 - adding private key to ssh agent 我可以在计算机上使用emacs通过ssh编译C代码到Linux终端吗? - Can I use emacs on my computer to compile C code via ssh to a linux terminal? Guacamole 0.9.3 SSH私钥,用于连接到AWS EC2 Linux实例 - Guacamole 0.9.3 SSH private key to connect to AWS EC2 Linux Instances Azure Linux VM 上的 OpenSSH SSH-2 私钥(旧 PEM 格式) - OpenSSH SSH-2 private key (old PEM format) on Azure Linux VM 退出非root用户的ssh后,如何保持Linux程序运行? - How can I keep my Linux program running after I exit ssh of my non-root user? 从私钥生成公钥 ssh 密钥 - Generate public ssh key from private key
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM