{"_id":"54d0340094f7980d0081b844","parentDoc":null,"version":{"_id":"54cf411f9d09bb0d00a17a1f","project":"54cf411f9d09bb0d00a17a1c","__v":14,"createdAt":"2015-02-02T09:19:27.656Z","releaseDate":"2015-02-02T09:19:27.656Z","categories":["54cf41209d09bb0d00a17a20","54cfb99bbba1a023008741af","54cfb9a65ff7e617002bbd7f","54cfba03bba1a023008741b6","54cfba0ebba1a023008741b8","54cfba19bba1a023008741b9","54cfba29bba1a023008741bb","54cfba345ff7e617002bbd87","54cfba3ebba1a023008741bc","54cfba473995cf0d0006f6f0","54e371b18ef7552300409bf2","54e37aa5e887c50d005ef629","555a4e9b147f91190092d137","56b0e91802f4bc0d006ce254"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"project":"54cf411f9d09bb0d00a17a1c","user":"54cfa8c8a8a4fd0d00b7fd1c","__v":33,"category":{"_id":"54cfba0ebba1a023008741b8","__v":15,"pages":["54d0331dc795960d009f4213","54d0333f94f7980d0081b83e","54d03369f530ca0d0005395d","54d0338894f7980d0081b840","54d033a8c795960d009f4216","54d033df94f7980d0081b842","54d0340094f7980d0081b844","54d034d0f530ca0d00053960","5531432b29603d2300011386","553529553ad5c90d00d0609c","5537df420899730d0081368a","553a6c030074c80d00621bd6","5571f7fe8956493700aae248","55dc0a267fa0290d00558e6c","56696a5155e4b32100935db5"],"project":"54cf411f9d09bb0d00a17a1c","version":"54cf411f9d09bb0d00a17a1f","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-02-02T17:55:26.712Z","from_sync":false,"order":3,"slug":"workspaces","title":"Workspaces"},"updates":["56f439f90f1f970e006e2515","57df8aeac6348d0e0020c443"],"next":{"pages":[],"description":""},"createdAt":"2015-02-03T02:35:44.204Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":8,"body":"One of the most useful features on Cloud9 is SSH workspaces. If you own a server that you can SSH into, you can log into that machine with Cloud9 and work on your projects remotely. Here's a video demonstrating how you could instantly compile a C program using an SSH workspace and Cloud9:\n[block:embed]\n{\n  \"html\": \"<iframe class=\\\"embedly-embed\\\" src=\\\"//cdn.embedly.com/widgets/media.html?src=http%3A%2F%2Fwww.youtube.com%2Fembed%2FCogX0tqugi0%3Ffeature%3Doembed&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCogX0tqugi0&image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FCogX0tqugi0%2Fhqdefault.jpg&key=02466f963b9b4bb8845a05b53d3235d7&type=text%2Fhtml&schema=youtube\\\" width=\\\"854\\\" height=\\\"480\\\" scrolling=\\\"no\\\" frameborder=\\\"0\\\" allowfullscreen></iframe>\",\n  \"url\": \"https://www.youtube.com/watch?v=CogX0tqugi0\",\n  \"title\": \"Cloud9 IDE: Bring Your Own Workspace\",\n  \"favicon\": \"https://s.ytimg.com/yts/img/favicon-vfldLzJxy.ico\",\n  \"image\": \"http://i.ytimg.com/vi/CogX0tqugi0/hqdefault.jpg\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"When you open an SSH workspace for the first time, Cloud9 runs a script to install a few things necessary to give you terminal access from Cloud9 ([check out the script here](https://github.com/c9/install/)). From time to time, hosting providers change things that break the script. If you see errors that appear to be related to this, please notify us right away [here](mailto:support:::at:::c9.io) so we can fix it immediately.\",\n  \"title\": \"Cloud9 Install Script\"\n}\n[/block]\n## Connection Prerequisites\n\nIn order to connect Cloud9 with a server you own, you'll need two things:\n\n  * Node.js installed on the server. This version must be at least version 0.6.16. To check your version, go to the terminal and execute `node -v`\n  * [Your public SSH key](https://c9.io/account/ssh) *must* be saved on the server at *~/.ssh/authorized_keys* ([see this article](https://www.digitalocean.com/community/tutorials/how-to-use-ssh-keys-with-digitalocean-droplets) for how to do this). This is to ensure the utmost security between your client computer and the machine you're attempting to access. Cloud9 provides you with your SSH key in the workspace dialog; it is up to you to save it to the appropriate path. \n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permissions for ~\",\n  \"body\": \"Your ~ directory on your server must have the following permissions: drwxr-xr-x.\"\n}\n[/block]\n## Creating an SSH Workspace\n\nOnce you've got those requirements set up, here's how you can create an SSH workspace of your own:\n\nIn the Projects tab on the Dashboard, click on the Project Add Icon next to **MY PROJECTS** and choose the option to **Create a new project** (see \"[Creating a New Workspace](doc:creating-a-new-workspace)\" if you need to review the steps to create a new project):\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ntPte63lQGy82U0nWDot_Create%20a%20new%20workspace.png\",\n        \"Create a new workspace.png\",\n        \"594\",\n        \"522\",\n        \"#eaeaea\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nFirst, go ahead and input a name and description for you workspace.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/nfW33YuFSy22ySAarec2_Screen%20Shot%202015-07-13%20at%205.10.49%20PM.png\",\n        \"Screen Shot 2015-07-13 at 5.10.49 PM.png\",\n        \"1790\",\n        \"632\",\n        \"#ebebeb\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nThen you'll want to make sure to choose to connect to your own development machine in the cloud.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/BeVyGQH5ReCJjZVtxuZc_Screen%20Shot%202015-07-14%20at%201.59.12%20PM.png\",\n        \"Screen Shot 2015-07-14 at 1.59.12 PM.png\",\n        \"1686\",\n        \"112\",\n        \"#e5e5e4\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nOnce you've selected that option, you'll see the page change to show this:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/wXQWppdURKWCaYkQp54i_Screen%20Shot%202015-07-14%20at%202.01.12%20PM.png\",\n        \"Screen Shot 2015-07-14 at 2.01.12 PM.png\",\n        \"1762\",\n        \"968\",\n        \"#ebebeb\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n### Workspace Values\n\nHere's some clarification on what these values mean:\n\n  * **Hostname**: the domain name or IP address (using the IP can solve problems and be more reliable) of the machine running your SSH server.\n  * **Username**: your username for the SSH server (might be root or something else).\n  * **Node.js Binary Path**: the location of your Node.js binary. If you're not sure where it is, you can always let Cloud9 guess it for you. Otherwise, on your server, type `which node`, to see the full path\n  * **Initial path**: this is an optional parameter. You can set it as an absolute (starts with `/`) path. Otherwise, it'll be set to a relative path, and Cloud9 assumes that you want to start from the folder your SSH server leaves you after login (usually the home or default folder).\n  * **Port**: this is an optional parameter. Cloud9 will automatically try to connect on port 22 \n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Warning: Be careful not to put an initial path that leaves you in a location where you don't have write privileges, as that could cause problems!\"\n}\n[/block]\nFill in your SSH details and click Create workspace to create your new SSH workspace.\n\nWhen you go back to your dashboard, you can always change your SSH settings by clicking on the name of the SSH workspace, and then clicking the gear wheel on the far right to change the settings. This can be useful if any information changes on your server.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/9pXUl6b6TFWTaZfPmcIQ_Screen%20Shot%202015-07-14%20at%202.14.20%20PM.png\",\n        \"Screen Shot 2015-07-14 at 2.14.20 PM.png\",\n        \"3840\",\n        \"578\",\n        \"#84aad0\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Warning: Make sure that you copied your SSH key correctly! Trailing spaces are significant, so make sure your text editor on your server is not modifying the key that Cloud9 is providing you with.\"\n}\n[/block]\n## Diagnosing SSH Issues\n\nIf your Cloud9 SSH workspace is not loading or your files, the file tree and terminals are showing the spinning loading icon forever this may be caused by Cloud9 being unable to communicate with your server. Please check the following:\n\n- Ensure your server is up and running. \n- Try and SSH into your server from your local machine, or via some other method. \n- Check that your [Public Cloud9 SSH key](https:/c9.io/account/ssh) is in the ~/.ssh/authorized_keys file for the user you are trying to log in with. \n- ensure that ssh files have correct permissions by running the following code\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"chmod go-w ~/\\nchmod 700 ~/.ssh\\nchmod 600 ~/.ssh/authorized_keys\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n- check that there is no proxy blocking repeated ssh connections from cloud9 ips\n\nIf the above are all good and you still cannot access your workspace please [send us a support request](https://c9.io/support)","excerpt":"","slug":"running-your-own-ssh-workspace","type":"basic","title":"Setting Up an SSH Workspace"}

Setting Up an SSH Workspace


One of the most useful features on Cloud9 is SSH workspaces. If you own a server that you can SSH into, you can log into that machine with Cloud9 and work on your projects remotely. Here's a video demonstrating how you could instantly compile a C program using an SSH workspace and Cloud9: [block:embed] { "html": "<iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=http%3A%2F%2Fwww.youtube.com%2Fembed%2FCogX0tqugi0%3Ffeature%3Doembed&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCogX0tqugi0&image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FCogX0tqugi0%2Fhqdefault.jpg&key=02466f963b9b4bb8845a05b53d3235d7&type=text%2Fhtml&schema=youtube\" width=\"854\" height=\"480\" scrolling=\"no\" frameborder=\"0\" allowfullscreen></iframe>", "url": "https://www.youtube.com/watch?v=CogX0tqugi0", "title": "Cloud9 IDE: Bring Your Own Workspace", "favicon": "https://s.ytimg.com/yts/img/favicon-vfldLzJxy.ico", "image": "http://i.ytimg.com/vi/CogX0tqugi0/hqdefault.jpg" } [/block] [block:callout] { "type": "success", "body": "When you open an SSH workspace for the first time, Cloud9 runs a script to install a few things necessary to give you terminal access from Cloud9 ([check out the script here](https://github.com/c9/install/)). From time to time, hosting providers change things that break the script. If you see errors that appear to be related to this, please notify us right away [here](mailto:support@c9.io) so we can fix it immediately.", "title": "Cloud9 Install Script" } [/block] ## Connection Prerequisites In order to connect Cloud9 with a server you own, you'll need two things: * Node.js installed on the server. This version must be at least version 0.6.16. To check your version, go to the terminal and execute `node -v` * [Your public SSH key](https://c9.io/account/ssh) *must* be saved on the server at *~/.ssh/authorized_keys* ([see this article](https://www.digitalocean.com/community/tutorials/how-to-use-ssh-keys-with-digitalocean-droplets) for how to do this). This is to ensure the utmost security between your client computer and the machine you're attempting to access. Cloud9 provides you with your SSH key in the workspace dialog; it is up to you to save it to the appropriate path. [block:callout] { "type": "info", "title": "Permissions for ~", "body": "Your ~ directory on your server must have the following permissions: drwxr-xr-x." } [/block] ## Creating an SSH Workspace Once you've got those requirements set up, here's how you can create an SSH workspace of your own: In the Projects tab on the Dashboard, click on the Project Add Icon next to **MY PROJECTS** and choose the option to **Create a new project** (see "[Creating a New Workspace](doc:creating-a-new-workspace)" if you need to review the steps to create a new project): [block:image] { "images": [ { "image": [ "https://files.readme.io/ntPte63lQGy82U0nWDot_Create%20a%20new%20workspace.png", "Create a new workspace.png", "594", "522", "#eaeaea", "" ] } ] } [/block] First, go ahead and input a name and description for you workspace. [block:image] { "images": [ { "image": [ "https://files.readme.io/nfW33YuFSy22ySAarec2_Screen%20Shot%202015-07-13%20at%205.10.49%20PM.png", "Screen Shot 2015-07-13 at 5.10.49 PM.png", "1790", "632", "#ebebeb", "" ] } ] } [/block] Then you'll want to make sure to choose to connect to your own development machine in the cloud. [block:image] { "images": [ { "image": [ "https://files.readme.io/BeVyGQH5ReCJjZVtxuZc_Screen%20Shot%202015-07-14%20at%201.59.12%20PM.png", "Screen Shot 2015-07-14 at 1.59.12 PM.png", "1686", "112", "#e5e5e4", "" ] } ] } [/block] Once you've selected that option, you'll see the page change to show this: [block:image] { "images": [ { "image": [ "https://files.readme.io/wXQWppdURKWCaYkQp54i_Screen%20Shot%202015-07-14%20at%202.01.12%20PM.png", "Screen Shot 2015-07-14 at 2.01.12 PM.png", "1762", "968", "#ebebeb", "" ] } ] } [/block] ### Workspace Values Here's some clarification on what these values mean: * **Hostname**: the domain name or IP address (using the IP can solve problems and be more reliable) of the machine running your SSH server. * **Username**: your username for the SSH server (might be root or something else). * **Node.js Binary Path**: the location of your Node.js binary. If you're not sure where it is, you can always let Cloud9 guess it for you. Otherwise, on your server, type `which node`, to see the full path * **Initial path**: this is an optional parameter. You can set it as an absolute (starts with `/`) path. Otherwise, it'll be set to a relative path, and Cloud9 assumes that you want to start from the folder your SSH server leaves you after login (usually the home or default folder). * **Port**: this is an optional parameter. Cloud9 will automatically try to connect on port 22 [block:callout] { "type": "warning", "body": "Warning: Be careful not to put an initial path that leaves you in a location where you don't have write privileges, as that could cause problems!" } [/block] Fill in your SSH details and click Create workspace to create your new SSH workspace. When you go back to your dashboard, you can always change your SSH settings by clicking on the name of the SSH workspace, and then clicking the gear wheel on the far right to change the settings. This can be useful if any information changes on your server. [block:image] { "images": [ { "image": [ "https://files.readme.io/9pXUl6b6TFWTaZfPmcIQ_Screen%20Shot%202015-07-14%20at%202.14.20%20PM.png", "Screen Shot 2015-07-14 at 2.14.20 PM.png", "3840", "578", "#84aad0", "" ] } ] } [/block] [block:callout] { "type": "warning", "body": "Warning: Make sure that you copied your SSH key correctly! Trailing spaces are significant, so make sure your text editor on your server is not modifying the key that Cloud9 is providing you with." } [/block] ## Diagnosing SSH Issues If your Cloud9 SSH workspace is not loading or your files, the file tree and terminals are showing the spinning loading icon forever this may be caused by Cloud9 being unable to communicate with your server. Please check the following: - Ensure your server is up and running. - Try and SSH into your server from your local machine, or via some other method. - Check that your [Public Cloud9 SSH key](https:/c9.io/account/ssh) is in the ~/.ssh/authorized_keys file for the user you are trying to log in with. - ensure that ssh files have correct permissions by running the following code [block:code] { "codes": [ { "code": "chmod go-w ~/\nchmod 700 ~/.ssh\nchmod 600 ~/.ssh/authorized_keys", "language": "shell" } ] } [/block] - check that there is no proxy blocking repeated ssh connections from cloud9 ips If the above are all good and you still cannot access your workspace please [send us a support request](https://c9.io/support)