If you want to work on your personal computer and run it on the CS computers, there are several options.
On pycharm you have to setup:
When connecting using bava.cs.huji.ac.il gateway, a tunnel should be created first. On the command line run the command:
ssh -CTN -l <CS-user> bava.cs.huji.ac.il -L <localport>:<remotehost>:22
Replace <CS-user> with your CS login, <localport> with any port number from 1024 to 65535 and <remotehost> with the host you want to connect to, usually river.
After entering the OTP, no response would be receive. leave the command line open for the tunnel to be opened.
On PyCharm, open the menu File->Settings and choose Tools->SSH Configuration and add a new connection:
host: localhost
port: the number you chose for <localport>
user: your CS username
Open the menu File->Settings and choose Tools->SSH Configuration and add a new connection:
host: <cshost> usually river.cs.huji.ac.il
port: 22
user: your CS username
Edit the connection with the pencil icon and give it a proper name for later use.
On an open project, go to the settings window and click on "Python Interpreter". Click on the cogwheel and choose "Add...". Then click on "SSH Interpreter", choose "Existing server configuration" and the configuration created previously. Click on Next and now you can choose the python version you want to use. In case you use the system's python, it should be /usr/bin/python for python2.7 or /usr/bin/python3 for the current python3 on the server.
For using a virtual environment, choose the python binary from inside the virtualenv (<virtualenv path>/bin/python)
On PyCharm settings choose Build, Execution, Deployment -> Deployment, click on the + sign and add sftp connection. Choose the connection created previously. Set up the Root Path with Autodetect.
Set the Advanced option of Concurent connections limit to 10, which is the limit on CS side.
In case that you have a subdirectory for all your PyCharm projects, set it up on the Mappings tab, in the Deployment path
VScode remote runs only when the shell is bash, which is not the case on the CS network
When logged in to a CS host, add the below lines to the bottom of your ~/.cshrc file:
if ( $?VSCODE_REMOTE_AGENT ) then setenv SHELL /usr/local/bin/bash exec $SHELL endif
All the actions are done in the VSCode IDE.
<csuser> and <cshost> to your CS username and the host you want to connect to, accordingly:bava gateway: ssh -J <csuser>@bava.cs.huji.ac.il <csuser>@<cshost>ssh <csuser>@<cshost>.cs.huji.ac.ilriver would do.Enter the Command Palette, and type in "remote-ssh", choose the "connect to host..." and the host you configured.
When connecting via gateway, the first password is an OTP password, and the second one is your CS.
When connecting via VPN or Eduroam, only your CS password is required.
You can setup SSH key for authentication, which replace the request for CS password (but not for OTP)
When connecting from linux, you may need to install linux package ssh-askpass for VSCode to be able to ask you for your password.