> For the complete documentation index, see [llms.txt](https://d3ndr1t30x.gitbook.io/breaking-things-a-junior-pentesters-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://d3ndr1t30x.gitbook.io/breaking-things-a-junior-pentesters-guide/transferring-files/creating-an-smb-share-on-kali-for-anonymous-access.md).

# Creating an SMB share on Kali for anonymous access

Creating an SMB share on your Kali Linux machine that allows for anonymous access can be done using the Samba software. Here are the steps to create an SMB share with anonymous access:

1. **Install Samba**: If you haven't already installed Samba, you can do so using the following command:

* ```bash
  sudo apt-get install samba
  ```
* **Create a Directory to Share**: Choose a directory that you want to share with anonymous access. For example, you can create a directory named "shared" in your home folder:
* ```bash
  mkdir ~/shared
  ```
* **Configure the SMB Share**: Edit the Samba configuration file to define the share. You can use a text editor like `nano` to open the configuration file:

```bash
sudo nano /etc/samba/smb.conf
```

Add the following lines at the end of the `smb.conf` file to define your anonymous share:

* ```plaintext
  [anonymous_share]
     path = /path/to/shared_directory
     public = yes
     writable = yes
     guest ok = yes
  ```

  Replace `/path/to/shared_directory` with the actual path to the directory you want to share.

  Here's what each option does:

  * `path`: Specifies the path to the directory you want to share.
  * `public`: Allows anonymous access.
  * `writable`: Allows write access to the share.
  * `guest ok`: Grants access without requiring a username or password.
* **Save and Close the Configuration File**: In `nano`, press `Ctrl + X`, then `Y` to confirm the changes and `Enter` to save the file.
* **Restart Samba**: After modifying the configuration, restart the Samba service to apply the changes:
* ```bash
  sudo service smbd restart
  ```
* **Check the Share**: You can now access the anonymous share from another machine on your network. Open a file browser and enter the following in the address bar (replace `kali-ip` with the IP address of your Kali machine):

1. ```arduino
   smb://kali-ip/anonymous_share
   ```

   You should be able to access the shared directory without a username or password.

Please note that enabling anonymous access to a share should be done with caution, as it can pose security risks. Make sure you only share directories that don't contain sensitive or critical data. If you need to share files securely, consider setting up proper user authentication and permissions.
