This tutorial is for Mac users. For Windows users, please first read the tutorial to install Git for Windows, which ships with Git Bash, then most bash commands in this tutorial will work in Git Bash.
SSH client on MacOS.
Terminal app. You can find Terminal from LaunchPad -> Other, or from Spotlight Search (type Terminal). For convenience, you can pin the Terminal program to the Dock.echo $SHELL
chsh -s /bin/bashConnect to the teaching server. On MacOS Terminal:
ssh [USERNAME]@server.ucla-biostat-203b.com
Replace [USERNAME] in the command by your actual user name (your email name in MyUCLA). If you cannot connect, you may not have an account. Ask TA or instructor for help.
Change password on teaching server
passwdYou can use git to obtain a copy of course materials:
git clone https://github.com/ucla-biostat-203b/2022winter.gitInstall R v4.1.2 or later. https://cran.rstudio.com
Install RStudio Desktop (Open Source Edition). https://rstudio.com/products/rstudio/#Desktop
Check whether git command is available in Terminal. If not, follow instructions at https://git-scm.com/book/en/v2/Getting-Started-Installing-Git Installing on macOS section to install it.
git clone and git pull course materialsgit installed, e.g., your Mac Terminal or teaching server, you can obtain the 203B course material by commandgit clone https://github.com/ucla-biostat-203b/2022winter.git [<dir>]
Replace [<dir>] by your preferred folder name, say 203b-2022winter.
cd /PATH/TO/LOCAL/REPO
then
git pull
If you have made commits to the local repo, then the two commits need to be merged.
File -> New Project... -> Version Control -> Git, then copy the git address (not HTTPS address) git@github.com:ucla-biostat-203b/2022winter.git to the Repository URL:.Open your browser and enter address http://server.ucla-biostat-203b.com:8787 to use RStudio on the teaching server. Log in using your credential for the teaching server.
ls -al ~/.ssh
If you donโt have ~/.ssh folder, that means you have never used SSH before.
Tools -> Global Options... -> Git/SVN. Using either method, make sure keys are in the default location ~/.ssh/~/.ssh folder should be 700 (drwx------).~/.ssh/id_rsa should be 600 (-rw-------).~/.ssh/id_rsa.pub should be 644 (-rw-r--r--).~/.ssh folder can be 755 (drwxr-xr-x).~/.ssh/id_rsa can be 644 (-rw-r--r--).~/.ssh/id_rsa.pub can be 644 (-rw-r--r--).~/.ssh.
~/.ssh folder should be 700 (drwx------).~/.ssh/id_rsa should be 600 (-rw-------).~/.ssh/id_rsa.pub should be 644 (-rw-r--r--).authorized_keys file should contain the public key (cannot duplicate) and its permission should be 600 (-rw-------).ssh [USERNAME]@server.ucla-biostat-203b.com