Remote Editing

From Cheaha
Jump to navigation Jump to search


Attention: Research Computing Documentation has Moved
https://docs.rc.uab.edu/


Please use the new documentation url https://docs.rc.uab.edu/ for all Research Computing documentation needs.


As a result of this move, we have deprecated use of this wiki for documentation. We are providing read-only access to the content to facilitate migration of bookmarks and to serve as an historical record. All content updates should be made at the new documentation site. The original wiki will not receive further updates.

Thank you,

The Research Computing Team

Visual Studio Code

To use the the SSH extension to access files on Cheaha, please follow the instructions in the documentation for installation. Once it is installed, follow these instructions to set up the SSH config file. The following assumes SSH is installed locally, and that a config file exists in the usual location for your operating system. The commands assume you have an open Visual Studio Code window.

  1. Open the command palette, default hotkey "Ctrl + Shift + P".
  2. Locate "Remote-SSH: Connect to Host..." by typing part of the command at the prompt.
  3. Set up an SSH config file
  4. Click the command in the palette prompt.
  5. Click "Configure SSH Hosts...".
  6. Choose the location of the existing config file.
  7. In the new editor window that opened, add the following lines then save the file.
Host cheaha
  HostName cheaha.rc.uab.edu
  User <username>

The text <username> should be replaced by the user name you use to access Cheaha. The "User" line is not necessary but can save some time.

SSH

With tmux

First, ssh into VM like normal:

ssh blazerid@cheaha.rc.uab.edu

If you are trying to edit file on VM, not Cheaha, make sure you have tmux installed on system.

# Ubuntu
sudo apt install tmux

# CentOS
sudo yum install tmux

Now, create a tmux session and detach right away.

tmux new

# Ctrl+B then D
^B d

You can exit this ssh connection now.

exit

This time, ssh with remote command and special option -t Force pseudo-terminal allocation.

ssh -t blazerid@cheaha.rc.uab.edu "tmux -CC attach"