User Guide

Linux

SSH Connection

  • Connect to a server: ssh <account>@<domain name>

    • To forward GUI: Install X11 in your laptop and use ssh -Y
  • The host information can be save into ~/.ssh/config. Here is an example:

Host host1
    HostName 127.0.0.1 # IP address or domain name
    User xxxxxxx
    ForwardAgent yes # forward local ssh key to get authorization from another host
    ForwardX11Trusted yes
    XAuthLocation /opt/X11/bin/xauth
    Port xxxxxx # if not using default port

Host host2
    Hostname 127.0.0.1
    User xxxxxx
    ProxyJump host2 # Use host1 as proxyjump

With the saved informaiton, you can use ssh host1 to connect to the server

  • Login without password (Do this only once on a server!) reference
~ $ ssh-keygen -t rsa -b 4096
~ $ ssh <account>@<domain name> mkdir -p .ssh
~ $ cat .ssh/id_rsa.pub | ssh <account>@<domain name> 'cat >> .ssh/authorized_keys'
~ $ ssh <account>@<domain name> "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"

File Transfer

  • Copy file: scp, e.g. scp <account>@<domain name>:/path/to/the/file .

    • Copy directory: scp -r
    • Alternative: rsync -aP <account>@<domain name>:/path/to/dir .
  • For client GUI, please refer to the table here

Access authority

  • If you are sharing a directory within a group members, use id -Gn to know which group you belongs to.

Computational resources

  • System moniter (help you know how many cores available): htop
  • Disk usage:
    • quota: space available in your account
    • df -h: space available in disks
    • du -sh .: space have been used in the current folder
  • Change program priority (consider it if you are using more than 30 cores): nice

Non-stopping running

If you are worried about your tasks interrupted by closed network - nohup <program> & to keep your program running - Interrupt program 1. ps -fu <username> to find the PID of the process you want to stop 2. kill <PID> to stop the process - tmux to launch a session. This session will be kept even if you are logged out - Detach from the session: Ctrl+b d returns from tmux session to your shell - List all running sessions: tmux ls - Attach a session: tmux attach connect back to a session from shell

VSCode

Git

Highly recommend everyone to learn git and apply in your projects! There are plenty of tutorial resources online. For example:

Github

Some benefits on Github:

Python

If you are new to python but have some programming concepts, this article could give you a sense of learning Python.