---
name: "libssh2_trace"
section: "3"
platform: "linux"
package: "libssh2"
version: "1.11.1-7"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libssh2_trace"
---

# libssh2\_trace(3)

enable debug info from inside libssh2

## NAME

libssh2\_trace - enable debug info from inside libssh2

## SYNOPSIS

```
#include <libssh2.h>
void
libssh2_trace(LIBSSH2_SESSION *session, int bitmask);
```

## DESCRIPTION

This is a function present in the library that can be used to get debug info from within libssh2 when it is running. Helpful when trying to trace or debug behaviors. Note that this function has no effect unless libssh2 was built to support tracing! It is usually disabled in release builds.

**bitmask** can be set to the logical OR of none, one or more of these:

- LIBSSH2\_TRACE\_SOCKET

  Socket low-level debugging

- LIBSSH2\_TRACE\_TRANS

  Transport layer debugging

- LIBSSH2\_TRACE\_KEX

  Key exchange debugging

- LIBSSH2\_TRACE\_AUTH

  Authentication debugging

- LIBSSH2\_TRACE\_CONN

  Connection layer debugging

- LIBSSH2\_TRACE\_SCP

  SCP debugging

- LIBSSH2\_TRACE\_SFTP

  SFTP debugging

- LIBSSH2\_TRACE\_ERROR

  Error debugging

- LIBSSH2\_TRACE\_PUBLICKEY

  Public Key debugging
