# How Do I Get into a Docker Container’s Shell?

If you want to explore containers file system it simply wan to get an access to containers shell, you can use one of the following options

## Using the `docker exec` command

Docker version 1.3 or newer supports the `docker exec` command. This command can run the new process in an already running container. This means you can run bash `/bin/bash`  in the container state like this:

```bash
docker exec -t -i container_name /bin/bash
```

## Using Snapshotting

You can peek into the docker file system by following these steps:

1. Find the id of your running container

```bash
docker ps
```

1. Create an image (snapshot) from the container file system

```bash
docker commit 12345678904b5 mysnapshot
```

1. Explore the file system using the bash

```bash
docker run -t -i mysnapshot /bin/bash
```

This way, you can evaluate the filesystem of the running container at the precise time moment. The container is still running, no future changes are included.

To delete the snapshot, run the following command:

```bash
docker rmi mysnapshot
```

## Using the `ssh`

If you want continuous access to the docker file system, you can install the `sshd` to your container and run the `sshd` daemon:

```bash
docker run -d -p 22 mysnapshot /usr/sbin/sshd -D
```

To see to which port to connect, run the following command:

```bash
docker ps
```
