gpt4 book ai didi

restricting .env file from other ssh admin(限制其他ssh管理员访问.env文件)

转载 作者:bug小助手 更新时间:2023-10-25 22:18:37 24 4
gpt4 key购买 nike



so myself, and a guild member of mine, are working ona bot
together for our server. Its first and main purpose was to link our path of exile accounts, with our discord accounts so we can identify members of the discord server and be able to tell who they are in-game. so far we have not had a problem doing this, or getting this part of the bot running 24/7 via nodejs and pm2.

因此,我和我的一名工会成员,正在为我们的服务器一起工作一个机器人。它的第一个也是主要的目的是将我们的流亡账户与我们的不和谐账户联系起来,这样我们就可以识别不和谐服务器的成员,并能够知道他们在游戏中是谁。到目前为止,我们还没有遇到这样的问题,或者让机器人的这一部分通过NodeJS和PM2全天候运行。


my first question is, since i am the guild's leader, and the bot is connected to MY DISCORDS DEV portal, it has my discord token in the .env file located in the bot's home folder.
as of rn, i know that the other admin has root access and can see my token. im not really worried about it at this time but who knows what the future may hold. so my question is, there anyway to make the .env file readable by pm2 or npm, but be able to hide my token or any other senstitve information like mongodb login from the other admin? without breaking the whole project becus i made the .env file unreadable?

我的第一个问题是,因为我是公会的领导人,并且机器人连接到我的Discords DEV门户,所以它在机器人的主文件夹中的.env文件中有我的Discord令牌。从Rn开始,我知道其他管理员拥有超级用户访问权限,并且可以看到我的令牌。我现在并不真的担心,但谁知道未来会是什么样子。所以我的问题是,无论如何,有没有办法使.env文件对PM2或NPM可读,但能够对其他管理员隐藏我的令牌或任何其他敏感信息,如MongoDB登录?没有破坏整个项目,因为我使.env文件不可读?


Pretty much i dont want him to be able to go in and nano ~/poe-discord/.env and be able to see my token. how can i set it up to where the token is unreadable by him

很大程度上,我不希望他能够进入和Nano~/poe-discord/.env,并且能够看到我的令牌。我如何才能将其设置为令牌无法被他读取


i still need/want him to have full root access tho.
if i set up two accounts , one for me and one for him, both "su" or "root", can i make certain files only readable by certain users?
can i make it pull the .env file from a seperate location that is only accessable by the account who made the file?

不过,我仍然需要/希望他拥有完全的超级用户访问权限。如果我设置了两个帐户,一个给我,一个给他,都是“su”或“root”,我可以使某些文件只对某些用户可读吗?我是否可以让它从一个单独的位置拉出.env文件,而该位置只能由创建该文件的帐户访问?


im unsure what to try first..

我不知道该先试什么。


更多回答

is this possible? thank you:)

这个是可能的吗?谢谢您:)

优秀答案推荐
更多回答

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com