2015-03-03 104 views
1

我使用的對BBB Debian的圖像從這裏加個密碼:Debian (BeagleBone Black - 2GB eMMC) 2014-05-14更改用戶名和CLOUD9在Beaglebone黑

此圖像具有CLOUD9 IDE內置。它適用於我的目的很好,但我不知道如何添加密碼。網絡上的任何人都可以訪問11.22.33.44:3000(不是實際的IP地址),IDE將自動以「John Doe」身份登錄(不需要密碼)。

登錄Cloud9時是否有辦法請求用戶名和密碼?如果瀏覽器保存密碼,我可以,但至少應該詢問一次。

回答

2

我只是發現瞭解決方案。

要設置默認的用戶名和密碼:

  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); 
    } 

  • 在線路.default("auth", ":"),在用戶名和密碼類型要在格式使用用戶名密碼,例如.default("auth", "user:pass")

  • 你應該全部設置!嘗試訪問11.22.33.44:3000,並且應該彈出提示輸入用戶名和密碼的提示。

  • 在一個側面說明,如果你想改變文件名(默認的 「李四」):

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

    2. 找到以下代碼塊。

     
    user: { 
          uid: 1, 
          name: "johndoe", 
          fullname: "John Doe", 
          email: "[email protected]", 
          pubkey: null 
         }, 
    
  • 更改的fullname值到想要的用戶名。

  • 重新啓動BeagleBone Black並轉至11.22.33.44:3000,您將在Cloud9 IDE上看到更新的配置文件名稱。

  • +1

    我不得不添加'.default(「auth」,「user:pass」)'但它工作。 – 2016-02-28 15:54:09

    2

    從命令行開始CLOUD9(至少在最新版本),你可以使用:

    -a user:pass

    其中「用戶」是用戶名,將允許和「通行證」是該用戶的密碼。它使用基本的Web認證。

    爲CLOUD9其它參數是:

    • -l [ip addresses to accept]使用0.0.0.0接受所有IP地址。
    • -w path/to/project/to/edit
    • -p port在其上運行

    至於用來啓動CLOUD9在其中調整啓動參數的特定的腳本/服務,我不知道。你可以試試這個信息從哪裏開始尋找:

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