===== Advanced ===== ==== Creating Shared Entities ==== Shared environments, modules and binaries can be created by any user inside corresponding directories: * /opt/shared_envs * /opt/shared_modules * /opt/shared_soft These directories have a sticky bit, i.e. everyone can use everything inside, but only the creators can modify their files. Shared Conda environments can be created by using //%%--%%prefix /opt/shared_envs/// flag. ==== Connecting via a Local Terminal ==== To connect to a compute node from the head node via SSH you have to grant yourself a shell access to the corresponding compute node via [[https://portal.darwin.bioeng.ru/pun/sys/dashboard/batch_connect/sys/bc_sbatch/session_contexts/new|Shell Access]] app. To connect to the head node itself (for a proxy jump from your local machine) you need to ask permission from an administrator. Once you have obtained access to the head node, execute the following commands locally (for Linux/macOS only, for Windows look up corresponding commands or connect without shortcuts whatsoever): **1.** Make shortcuts for SSH connections: echo -n "Enter your login (e.g. i_petrov): " read LOGIN cat >> ~/.ssh/config << EOF Host darwin HostName darwin.bioeng.ru User $LOGIN EOF for i in $(seq -w 1 14); do cat >> ~/.ssh/config << EOF Host darwin_node$i HostName node$i User $LOGIN ProxyJump darwin EOF done **2.** Create an SSH key pair (skip this step if you have done this before): ssh-keygen **3.** Copy your public key to the head node: ssh-copy-id darwin **4.** Connect to a compute node using your terminal or SSH client (change the node number to an assigned one for your job): ssh darwin_node01 ==== Connecting via a Local IDE ==== The Darwin Portal provides a simple way to use Code-Server (a.k.a. VS Code) in your browser (Apps ---> [[https://portal.darwin.bioeng.ru/pun/sys/dashboard/batch_connect/sys/bc_codeserver/session_contexts/new|VS Code]]). But if you want to use your local IDE you need to get SSH access to the head node (see [[portal_guides:advanced#Connecting via a Local Terminal|Connecting via a Local Terminal]]), since such IDEs operate over SSH under the hood. Then use your IDE capabilities to open a remote window. For VS Code and its forks (Cursor, Windsurf, etc.) use the "Remote SSH" extension. Sometimes extensions in VS Code and its forks cannot be installed remotely without a proxy, and if so, you have to enable it. The following instructions are adapted for Cursor only, so you have to adjust them for your own IDE if it is not Cursor. **1.** Turn on system proxy on your local machine (look up the proxy port and insert it instead of 10808 in the next command) **2.** Forward a proxy port (execute locally and leave launched): ssh -N -R 10808:127.0.0.1:10808 darwin **3.** Add proxy settings for IDE (remotely): cat > ~/.cursor-server/data/Machine/settings.json << EOF { "http.proxy": "http://127.0.0.1:10808", "http.proxySupport": "override" } EOF **4.** Install desired extensions (remotely) If Cursor says extensions.json cannot be found, execute (remotely): mkdir ~/.cursor-server/extensions && touch ~/.cursor-server/extensions/extensions.json and install extensions again **5.** Remove the proxy setting (remotely): rm -f ~/.cursor-server/data/Machine/settings.json ==== Running Long Scripts from Shell ==== Processes started inside an SSH session are terminated by Slurm when the session ends. To keep a script running after disconnect, submit it as a separate Slurm job (see [[portal_guides:slurm|Slurm Guide]]). ==== Why Did I Get Banned from SSH ==== We use Fail2Ban to protect the server. If there are 10 unsuccessful SSH login attempts within 10 minutes, the IP address is automatically banned for 20 hours. If you have forgotten your password, please do not try to brute-force it. Instead, contact an administrator to reset it.