Skip to content

1. Productivity Tips

Essentaial Extensions

Material Icon Theme

Todo Tree

Pretty Formatter

Docker

Docker

packages/4_dev/1_ide/public/assets/pdfs/vscode-keyboard-shortcuts-windows.pdf packages/4_dev/1_ide/public/assets/pdfs/vscode-keyboard-shortcuts-macos.pdf packages/4_dev/1_ide/public/assets/pdfs/vscode-keyboard-shortcuts-linux.pdf

SSH

https://youtu.be/C8oFdXE-WAw

https://code.visualstudio.com/docs/remote/ssh

Multiple environments

In VS Code, setting up multiple environments for various users to work simultaneously on your PC requires creating isolated development environments for each user. Here’s how you can set this up:

  1. Install a Tunneling Solution: Use a tool like VS Code Live Share or SSH tunneling. Live Share lets you collaborate in real-time but doesn’t offer separate, persistent environments for each user.

  2. Create Separate Containers: Use Docker to create individual containers, each with its own environment (e.g., language runtime, dependencies). Docker can isolate resources and processes for each user, but setting up multiple containers to use VS Code can be complex.

  3. Setup Remote SSH Sessions for Each User: Use the Remote - SSH extension in VS Code. Each user can SSH into the server and open their isolated VS Code instance. You can create separate user accounts on your PC, each with different permissions and workspaces.

  4. Leverage Codespaces or a Cloud Environment: For a simpler setup, consider using GitHub Codespaces or a cloud-based IDE like Repl.it for each user, as these tools provide isolated environments and simplified collaboration without requiring setup on your local machine.

Would you like more details on any of these steps?

########

For option 3, using Remote SSH sessions for each user in VS Code, here’s how you can set it up:

Steps

  1. Create Separate User Accounts:

    • On your PC, create individual user accounts for each person who needs access. Each account will have its own workspace and permissions.
    • You can do this by opening a terminal and running commands like:
      Terminal window
      sudo adduser username
    • Repeat for each user, replacing username with the unique username for each person.
  2. Set Up SSH Access:

    • For each user, create an SSH key (or have them create one on their local machine). Add each user’s public key to their respective ~/.ssh/authorized_keys file on your PC.
    • This will allow each user to SSH into their unique account. You can specify which port each user connects through for added security, or have them all use the default SSH port (22).
  3. Install VS Code and Configure Remote - SSH:

    • On each user’s local machine, they should install the Remote - SSH extension.
    • In their VS Code, they can configure SSH access by adding an entry in the ~/.ssh/config file:
      Host your-host-alias
      HostName your-server-ip
      User username
      Port 22 # or specify a unique port per user if configured
    • Replace your-host-alias with any alias, your-server-ip with your PC’s IP address, and username with their assigned username.
  4. Access the Environment:

    • Users can then use Remote - SSH in VS Code to connect to their specific user environment on your PC.
    • Each session will open in their own workspace on your machine, allowing isolated workspaces.
  5. Resource Management (optional):

    • To limit resource usage, consider setting resource quotas for each user if using a Linux environment. This can help prevent one user from consuming all system resources.

This setup allows each user to have an isolated, secure workspace in VS Code on your PC. Let me know if you’d like specific commands or further configuration tips for any step!

If your PC is running Windows, the setup differs a bit:

Steps for Remote SSH Access on Windows

  1. Enable SSH Server on Windows:

    • Go to Settings > Apps > Optional features.
    • Scroll down to find OpenSSH Server and install it (if not already installed).
    • After installation, go to Services and ensure OpenSSH SSH Server is running. Set it to start automatically.
  2. Create User Accounts:

    • Open PowerShell as Administrator and create a new user for each person:
      Terminal window
      New-LocalUser -Name "username" -NoPassword
    • Add each user to a group if needed (like Remote Desktop Users), so they can log in:
      Terminal window
      Add-LocalGroupMember -Group "Remote Desktop Users" -Member "username"
  3. Configure SSH Access:

    • For each user, generate an SSH key on their machine.
    • Add each user’s public key to the authorized_keys file located at C:\Users\username\.ssh\authorized_keys on your Windows PC.
  4. Configure VS Code Remote - SSH:

    • Each user should install Remote - SSH in their VS Code.
    • Add the Windows PC’s IP address and their unique username in their ~/.ssh/config:
      Host your-windows-host
      HostName your-windows-ip
      User username
      Port 22
  5. Access via Remote - SSH in VS Code:

    • Users can now connect to their accounts on your PC via Remote - SSH in VS Code.

Each user will have access only to their unique workspace. Let me know if you want more details on any part!