Skip to content

Commit eeb84ce

Browse files
authored
Merge pull request #233 from eecs280staff/ssh-fix
Improve CAEN Linux Tutorial
2 parents b07d259 + 6b01c97 commit eeb84ce

File tree

1 file changed

+45
-64
lines changed

1 file changed

+45
-64
lines changed

docs/setup_caen.md

Lines changed: 45 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ To access CAEN Linux from off campus, you'll first need to connect to the UM VPN
3636
Test an SSH connection. Be sure to change `awdeorio` to your own uniqname.
3737

3838
```console
39-
39+
4040
The authenticity of host 'login-course.engin.umich.edu (141.213.74.65)' can't be established.
4141
ECDSA key fingerprint is SHA256:LL0GPTtaVGa6gvv2kVpGq4ZULA1l5pw2wXC4dK3ymIk.
4242
Are you sure you want to continue connecting (yes/no)? yes
@@ -53,7 +53,7 @@ Enter a passcode or select one of the following options:
5353
Passcode or option (1-3): 1
5454
Success. Logging you in...
5555
...
56-
-bash-4.2$
56+
$
5757
```
5858

5959
If you are prompted with
@@ -66,6 +66,12 @@ Are you sure you want to continue connected (yes/no/[fingerprint])?
6666

6767
Enter **yes**. This is due to CAEN's Linux Remote Login Service changing URLs.
6868

69+
You are now logged in to a *different computer*, `caen-vnc-vm16` in this example. Yours may be different.
70+
```console
71+
$ hostname
72+
caen-vnc-vm16.engin.umich.edu
73+
```
74+
6975
Exit as soon as your test is successful.
7076
```console
7177
$ exit
@@ -76,11 +82,37 @@ Connection to login-course.engin.umich.edu closed.
7682
**Pitfall:** If you are off campus, make sure you have connected to the [UM VPN](https://its.umich.edu/enterprise/wifi-networks/vpn/getting-started).
7783
</div>
7884

79-
## Copy with `rsync`
80-
Next, we will copy our source code to CAEN Linux using the `rsync` command line program.
85+
## Copy code to CAEN
86+
Copy your code to CAEN Linux. The best choice is Git. If you haven't set up a Git repository, then you can use `rsync`.
87+
88+
### Option 1: `git`
89+
If you have a Git repository, check out a copy of your code.
90+
91+
SSH to a CAEN Linux machine.
92+
```console
93+
94+
```
95+
96+
Change to your home directory and `git clone` your repo.
97+
```console
98+
$ cd ~ # This will move to your home directory
99+
$ git clone [email protected]:awdeorio/p1-stats.git
100+
$ ls
101+
p1-stats
102+
```
103+
104+
### Option 2: `rsync`
105+
An alternative is to copy your source code to CAEN Linux using the `rsync` command line program.
81106

82107
<div class="primer-spec-callout warning" markdown="1">
83-
**Pitfall:** Make sure you're in the directory containing your source code.
108+
**Pitfall:** Make sure you're on your laptop, not CAEN linux
109+
```console
110+
$ hostname
111+
caen-vnc-mi01.engin.umich.edu # This is CAEN Linux
112+
$ exit # Exit CAEN Linux
113+
```
114+
115+
Make sure you're in the directory containing your source code *on your laptop*.
84116
```console
85117
$ ls
86118
main.cpp
@@ -118,19 +150,17 @@ total size is 8818 speedup is 0.90
118150
**Pitfall:** If you are off campus, make sure you have connected to the [UM VPN](https://its.umich.edu/enterprise/wifi-networks/vpn/getting-started).
119151
</div>
120152

121-
## Login with `ssh`
122-
Now log in to CAEN Linux. Your terminal is now a shell on a *different computer*, `caen-vnc-vm16` in this example. Yours may be different. Don't forget to change `awdeorio` to your own uniqname.
123-
```console
124-
125-
$ hostname
126-
caen-vnc-vm16.engin.umich.edu
127-
```
128-
153+
## Compile and run on CAEN
129154
<div class="primer-spec-callout warning" markdown="1">
130155
**Pitfall:** If you are off campus, make sure you have connected to the [UM VPN](https://its.umich.edu/enterprise/wifi-networks/vpn/getting-started).
131156
</div>
132157

133-
Notice that the folder copied earlier.
158+
Connect to CAEN.
159+
```console
160+
161+
```
162+
163+
Notice that the folder copied earlier. If you used Git, it will be called `p1-stats`
134164
```console
135165
$ ls
136166
p1-stats-copy
@@ -154,11 +184,9 @@ A good practice is to run a regression test on CAEN Linux. In EECS 280, that's
154184
$ make test
155185
```
156186

157-
Log out. Notice that after logging out, you are back to using a shell on your laptop.
187+
Log out.
158188
```console
159189
$ exit
160-
$ hostname
161-
your-laptop-name
162190
```
163191

164192
## Avoiding repeated 2FA
@@ -200,53 +228,6 @@ Success. Logging you in...
200228
$
201229
```
202230

203-
Open a second terminal and run an `rsync` command, which uses the new configuration. No authentication is required!
204-
```console
205-
$ rsync -rtv --exclude '.git*' ../p1-stats/ [email protected]:p1-stats-copy/
206-
building file list ... done
207-
208-
sent 273 bytes received 20 bytes 586.00 bytes/sec
209-
total size is 13015 speedup is 44.42
210-
```
211-
212-
<div class="primer-spec-callout warning" markdown="1">
213-
**Pitfall:** Make sure you're in the directory containing your source code.
214-
```console
215-
$ ls
216-
main.cpp
217-
```
218-
</div>
219-
220-
<div class="primer-spec-callout warning" markdown="1">
221-
**Pitfall:** If you are off campus, make sure you have connected to the [UM VPN](https://its.umich.edu/enterprise/wifi-networks/vpn/getting-started).
222-
</div>
223-
224-
225-
## Version control on CAEN Linux
226-
An alternative to copying code to CAEN Linux is checking out a your code from GitHub.
227-
228-
SSH to a CAEN Linux machine and see the copy we made earlier using `rsync`.
229-
```console
230-
231-
$ ls
232-
p1-stats-copy # this is from our rsync'ed copy earlier
233-
```
234-
235-
Notice that the copy is *not* under version control.
236-
```console
237-
$ cd p1-stats-copy
238-
$ git status
239-
fatal: Not a git repository (or any of the parent directories): .git
240-
```
241-
242-
Change directory and `git clone` your repo.
243-
```console
244-
$ cd ~ # This will move to your home directory
245-
$ git clone https://github.com/awdeorio/p1-stats.git
246-
$ ls
247-
p1-stats p1-stats-copy
248-
```
249-
250231
## Pro-tips
251232

252233
### Synchronizing deleted files

0 commit comments

Comments
 (0)