在 Beaglebone black 中为 Cloud9 更改用户名并添加密码

Change the username and add a password for Cloud9 in the Beaglebone black

我在此处为 BBB 使用 Debian 映像:Debian (BeagleBone Black - 2GB eMMC) 2014-05-14

此映像内置 Cloud9 IDE。它非常适合我的目的,但我不知道如何添加密码。网络上的任何人都可以访问 11.22.33.44:3000(不是实际 IP 地址),IDE 会自动将他们登录为 "John Doe"(无需密码)。

有没有办法在登录Cloud9时请求用户名和密码?如果浏览器保存密码我没问题,但它应该至少询问一次。

从命令行启动 Cloud9(至少是最新版本)时,您可以使用:

-a user:pass

其中 "user" 是它将允许的用户名,"pass" 是该用户的密码。它使用基本的 Web 身份验证。

Cloud9 的其他参数是:

  • -l [ip addresses to accept] 使用 0.0.0.0 接受所有 IP 地址。
  • -w path/to/project/to/edit
  • -p port 操作

至于用于启动 Cloud9 以调整启动参数的特定 script/service,我不确定。您可以尝试此信息以了解从哪里开始寻找:

https://dcinglis.wordpress.com/2014/09/08/running-a-startup-script-on-a-beaglebone-black/

我刚刚找到解决方案。

设置默认用户名和密码:

  1. 打开文件/opt/cloud9/build/standalonebuild/configs/standalone.js.

  2. 找到以下代码块。 (应该在文件的顶部)

    if (!optimist.local) {
        optimist
            .boolean("t")
            .describe("t", "Start in test mode")
            .describe("k", "Kill tmux server in test mode")
            .default("b", false)
            .describe("b", "Start the bridge server - to receive commands from the cli")
            .default("w", config.workspaceDir)
            .describe("w", "Workspace directory")
            .alias("p", "port")
            .default("port", process.env.PORT || config.port)
            .describe("port", "Port")
            .alias("d", "debug")
            .default("debug", false)
            .describe("debug", "Turn debugging on")
            .alias("l", "listen")
            .default("listen", process.env.IP || config.host)
            .describe("listen", "IP address of the server")
            .boolean("help")
            .describe("workspacetype")
            .alias("ws", "workspacetype")
            .describe("readonly", "Run in read only mode")
            .alias("ro", "readonly")
            .describe("packed", "Whether to use the packed version.")
            .boolean("packed")
            .default("packed", config.packed)
            .alias("a", "auth")
            .describe("auth", "Basic Auth username:password")
            .default("auth", ":")
            .describe("collab", "Whether to enable collab.")
            .default("collab", config.collab)
            // @lennartcl this should be moved
            .describe("lb.fileserver", "LogicBlox file server Url")
            .default("lb.fileserver", config.logicblox && config.logicblox.fileServerURL);
    }

  1. .default("auth", ":") 行,输入您要使用的用户名和密码,格式为 用户名:密码,例如.default("auth", "user:pass")

  2. 你应该准备好了!尝试访问 11.22.33.44:3000,应该会有一个弹出窗口提示输入用户名和密码。

附带说明,如果您想更改配置文件名称(默认 "John Doe"):

  1. 打开文件/opt/cloud9/build/standalonebuild/settings/standalone.js.

  2. 找到以下代码块。

user: {
            uid: 1,
            name: "johndoe",
            fullname: "John Doe",
            email: "johndoe@example.org",
            pubkey: null
        },
  1. fullname 的值更改为您想要的用户名。

  2. 重新启动 BeagleBone Black 并转到 11.22.33.44:3000,您将在 Cloud9 IDE.

  3. 上看到更新的配置文件名称