How do team members of a workspace open a unique instance of terminal?

workspace

#1

I’m using C9 as a platform to allow my students to run their code. Sometimes the commands used in one student’s terminal will appear in the terminal of another student, which might confuse the latter student. Is there a way to keep the terminal output separated for each student (10 total).


#2

they can use the + button in the tabbar and select new terminal


#3

Though note that all terminals are actually shared and viewable by other students. To see a full list of open tabs open the Collaborate panel on the right side and expand the arrow next to each user’s name. This will allow you to open up a file or terminal that this user has open.

Instructing students to open a new tab will typically solve this problem but if you’d prefer students not to interfere with one another then you’ll likely want them to have their own workspaces.


#4

Thanks for the advice.

I’m teaching 5-8th graders how to create and run basic programs in an IDE but they’re a little bit goofy and love to annoy each other haha. They’re still getting use to command-line but they’ve shown that they have the capacity to learn (they’re learning python atm).

Still, they’re a little bit “clutsy” and will sometimes inadvertently modify a file to be syntactically invalid. I’d be great if I could control file r/w permission for specific collaborators for particular directories and files. For instance: Collaborator A can only modify the contents of Directory A (for each student A in my class).

Is there a way to keep this level of access using file permissions in Linux (or some linux utility?) I’m trying my best to avoid teaching them the overhead of creating a workspace, etc…


#5

While I would certainly recommend using workspaces as they are fairly simple to set up, if that’s not an option you might be able to do the following to separate students into folders, but it would require a lot of work on your part, and I’m not exactly sure how to go about it:

  • Add a new Ubuntu user for each student (sudo adduser <username>)
  • Set their home folders to be writable only by themselves (sudo chown <username> /home/ubuntu/<username>)
  • Open the Cloud9 Init Script (Cloud9 Menu> Open Your Init Script)

Here, you’ll have to get creative. Try looking through the Cloud9 SDK Documentation if you get stuck. You’ll need to write a script that does the following two actions:

  • Listens for a new Cloud9 tab being opened
  • If it is a terminal, log the user in to their specific Ubuntu user

and

  • Listens for changes to files
  • If the file is editable by the user that edited it, then allow the change
  • Otherwise, cancel the change

You should be all set at this point! Be aware that I have only tinkered with the init script, and I’m not even sure if any of this is possible. Even if it is, it’s not terrible good. For one, all it would take for a student to escape the sandbox and return to a user with sudo privileges is to run exit, and even if you manage to sandbox their activity, they wouldn’t have sudo privileges (which may or may not be necessary). There are probably other solutions, but most will be fairly complex due to the fact that Cloud9 Users are not connected to Ubuntu users.


#6

The comments @dannytech made are spot on. The only thing I’ll do is emphasize that I’d just have them use their own workspaces. Workspace sharing is best used sparingly and to improve code reviews and select pairing. I hardly ever use it to work with a coworker on the same project. When I do, I quickly repent afterward :stuck_out_tongue_winking_eye: