运行时添加: -a user:pass

node /cloud9/server.js –listen –port 80 -w /workspace -a user:pass

To set a default username and password:

Open the file /opt/cloud9/build/standalonebuild/configs/standalone.js.

Locate the following code block. (Should be at the top of the file)

    if (!optimist.local) {
            .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 ||
            .describe("listen", "IP address of the server")
            .alias("ws", "workspacetype")
            .describe("readonly", "Run in read only mode")
            .alias("ro", "readonly")
            .describe("packed", "Whether to use the packed version.")
            .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);

At the line .default(“auth”, “:”), type in the username and password you’d like to use in the format of username:password, e.g. .default(“auth”, “user:pass”)

You should be all set! Try accessing, and there should be a pop-up prompting for username and password.