virli/subject/2/sample.md

60 lines
1.9 KiB
Markdown
Raw Normal View History

2018-11-07 11:23:01 +00:00
Exemples
========
## Arguments de la ligne de commande
<div lang="en-US">
```
42sh$ ./mymoulette -h
MyMoulette, the students' nightmare, now highly secured
Usage: ./mymoulette [-v student_workdir] environment moulette_prog [moulette_arg [...]]
environment is the path to the directory containing the new rootfs
moulette_prog will be the first program to be launched, must already be in the environment
student_workdir is the directory containing the code to grade
```
</div>
## Réseau accessible
<div lang="en-US">
```
42sh$ ip address show veth0l
2: veth0l@if82: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP mode DEFAULT group default
link/ether 42:a2:a0:89:54:ef brd ff:ff:ff:ff:ff:ff
inet 10.10.10.41/24 brd 10.10.10.255 scope global veth3e06cad
valid_lft forever preferred_lft forever
42sh$ ./mymoulette ./newrootfs/ /usr/bin/ip address show veth0r
2: veth0r@if82: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP mode DEFAULT group default
link/ether 42:a2:a0:89:55:ef brd ff:ff:ff:ff:ff:ff
inet 10.10.10.42/24 brd 10.10.10.255 scope global veth3e06cad
valid_lft forever preferred_lft forever
42sh$ ping -c 1 10.10.10.42
PING 10.10.10.42 (10.10.10.42) 56(84) bytes of data.
64 bytes from 10.10.10.42: icmp_seq=1 ttl=56 time=3.90 ms
--- 10.10.10.42 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 1003ms
rtt min/avg/max/mdev = 3.789/3.847/3.906/0.085 ms
```
</div>
<div lang="en-US">
```
42sh$ ./mymoulette ./newrootfs/ /usr/bin/curl http://www.linuxcontainers.org/ | md5sum
c7d68d1cb4737125a84cd69f55add202
```
</div>
## Capabilities limitées
<div lang="en-US">
```
42sh$ ./mymoulette ./newrootfs/ /bin/ping 9.9.9.9
ping: icmp open socket: Permission denied
```
</div>