Pull the image from DockerHub, if you haven't already
docker pull securesystemslab/lind
Creating a new container:
docker run --privileged --ipc=host --cap-add=SYS_PTRACE -it securesystemslab/lind /bin/bash
This document provides a step-by-step guide to access the NYU SSH server and run Docker commands to set up and test the Lind project. If you face issues while accessing the server, troubleshooting steps are included to help you resolve them efficiently.
To gain access, use the following SSH command format:
[username]@lind-server.engineering.nyu.edu
Description: Replace [username]
with your NYU username to connect to the Lind server. This command will initiate a secure shell connection to the server, allowing you to work on the remote system.
-
Description: This usually means that the password is incorrect. Please try to recall the correct password or contact seniors for assistance, or ask for help in the Slack channel.
To verify network connectivity, follow these steps:
-
Are you on an on-campus network?
-
If connected but still unable to access, contact seniors or use the Slack channel for support.
-
If not connected to the on-campus network, connect to VPN via the NYU VPN Guide.
Once you have SSH access, run the Docker container with the following command:
docker run --privileged --ipc=host --cap-add=SYS_PTRACE -it securesystemslab/lind /bin/bash
Description: This command starts a Docker container using the image securesystemslab/lind
. The options used are:
--privileged
: Grants extended privileges to the container.--ipc=host
: Allows the container to share the host’s IPC namespace, enabling shared memory.--cap-add=SYS_PTRACE
: Adds the capability to useptrace
, which is helpful for debugging.-it
: Opens an interactive terminal session./bin/bash
: Launches a Bash shell inside the container.
Note: This command will give you an interactive shell inside the Docker container where you can run other commands.
Once inside the container:
-
Ensure you are on the
develop
branch. Run the following commands to check and update:git branch
Description: Displays the current branch. Ensure that you are on the
develop
branch.git pull
Description: Fetches the latest updates from the remote repository and merges them into your current branch.
-
Update Contents:
-
Run the following command to update contents to the newest version:
make -2
Description: This command will ensure that all the components are updated to the latest version. The
make
command runs the instructions defined in the Makefile, and the-2
argument here specifies a particular target or set of actions.
-
-
Build the Regular Lind Version:
-
Run the following command to build the standard version of Lind:
make -1
Description: This command builds the standard version of Lind, preparing it for use.
-
You cannot directly use gcc
to compile programs for Lind. Instead, you can run the tool lindsh
first, and use the commands compile
, gcc
, or cc
in this special compiler.
Compile the hello.c
file under the /home/lind/lind_project/tests/test_cases/
directory
$ lindsh
@[/home/lind/lind_project] lind> compile [absolutepath]/path/to/hello.c -o /home/lind/lind_project/hello.nexe
If you’re inside lindsh:
cp /home/lind/lind_project/hello.nexe hello.nexe
From container:
lindfs cp ~/the/path/ /home/lind/lind_project/hello.nexe hello.nexe
The first argument is where your executable file is located in the container. The second argument is where you want to put your executable in the Lind file system. Note you have to give the executable file a name in the Lind file system.
The cp
command can also recursively copy directories--if your second argument is a directory, it will copy the directory and any of its contents recursively, their paths are still relative to the first argument.
After exiting lindsh
you can use the lindfs
tool to check if it exists in the lind filesystem.
lindfs find | grep 'hello'
Alternatively, you can use lindsh ls /[path]/
to run a ls command and locate the file.
If you see your executable file is under the path you designated before, it means that you have successfully copied the file into the Lind file system.
You can run the executable with lind /[path]/hello.nexe
or run /hello.nexe
if you are in lindsh
(alternate aliases for this command are r
, exec
, and execute
).