# Outgoing SMB connections

Host, port, NTLM credentials and share-rooted remote paths for Windows file shares.

An outgoing SMB connection is how a Zato service reaches a Windows file share, or anything else speaking SMB. Services look connections up by the name given here.

In Dashboard, go to `Connections → Outgoing → SMB` and click Create.

The fields:

| Name | Notes |
| --- | --- |
| Name | The name of the connection, as used in your services |
| Host | The remote server's host |
| Port | The remote server's port, with a default of 445 |
| Username | The username to log in with |
| Password | The password to log in with |

The connection authenticates with NTLM, using the username and password from its definition. Everything else, such as the protocol dialect, signing and encryption, is negotiated with the remote server automatically.

## Paths {#paths}

Every remote path starts with the name of the share, followed by directories and the file itself, using forward slashes:

```text
MyShare/documents/invoice.pdf
```

An SFTP path is rooted in the remote file system, an SMB path is rooted in a share. A directory that is `/incoming/invoices` on an SFTP server is `MyShare/incoming/invoices` on a share, and that includes the directory a [schedule](https://zato.io/docs/dev/file-transfer/schedules.html) is given.

## What you can do with the connection {#what-you-can-do-with-the-connection}

Once the connection exists, a service reaches it through `self.smb`:

```python
from zato.server.service import Service

class MyService(Service):

    def handle(self):

        conn = self.smb['My SMB Connection']
        conn.ping()
```

See [the connection API](https://zato.io/docs/dev/file-transfer/connection-api.html) for everything the connection object offers, and [file transfer schedules](https://zato.io/docs/dev/file-transfer/schedules.html) for having Zato watch a directory on this share for you.

## Learn more {#learn-more}

- [File transfer](https://zato.io/docs/dev/file-transfer/) - SFTP, FTP and SMB behind one API, driven by your code or by a schedule
- [The connection API](https://zato.io/docs/dev/file-transfer/connection-api.html) - Upload, download, read, write, list and manage remote entries
- [Schedules](https://zato.io/docs/dev/file-transfer/schedules.html) - Have Zato watch a remote directory and invoke a service per file
- [Receiving files](https://zato.io/docs/dev/file-transfer/receiving-files.html) - What the service receives, and the two ways to refuse a file
- [Real-world feeds](https://zato.io/docs/dev/file-transfer/feeds.html) - Marker files, archiving, bad files and pausing a feed
- [File transfer in enmasse](https://zato.io/docs/dev/file-transfer/enmasse.html) - Connections and schedules as YAML, ready for version control
