Go to file
Nicola Murino ad5b1e7569
CI / Run test cases (1.23, macos-latest) (push) Has been cancelled Details
CI / Run test cases (1.23, ubuntu-latest) (push) Has been cancelled Details
CI / Run test cases (1.24, ubuntu-latest) (push) Has been cancelled Details
Update SECURITY.md
2025-10-06 14:40:56 +02:00
.github/workflows CI: swith to Go 1.23 and 1.24 2025-03-28 10:26:22 +01:00
examples examples/go-sftp-server: add '-wr' 2025-01-01 16:06:54 +01:00
internal/encoding/ssh/filexfer bug: doesn't return buf.Err 2023-03-27 17:25:27 +00:00
server_standalone server_standalone: handle readonly properly 2017-03-15 12:45:09 -07:00
.gitignore split benchmark and benchmark_w_memprofile, include memprofile files to gitignore 2021-03-17 20:17:15 +00:00
CONTRIBUTORS Adding myself as I'm helping out 2017-01-06 17:20:11 -08:00
LICENSE Rename LICENCE to LICENSE 2014-10-27 21:31:41 +00:00
Makefile split benchmark and benchmark_w_memprofile, include memprofile files to gitignore 2021-03-17 20:17:15 +00:00
README.md update documentation links 2021-01-20 13:52:30 +01:00
SECURITY.md Update SECURITY.md 2025-10-06 14:40:56 +02:00
allocator.go the allocator can now be enabled per request 2020-03-18 09:36:07 +01:00
allocator_test.go the allocator can now be enabled per request 2020-03-18 09:36:07 +01:00
attrs.go rework client to prevent after-close usage, and support perm at open 2024-01-19 00:20:23 +00:00
attrs_stubs.go refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
attrs_test.go collect all marshal/unmarshal functions into packet.go 2021-08-11 11:12:34 +00:00
attrs_unix.go try support zos s390x 2024-03-15 01:07:06 +00:00
client.go DO NOT close the CopyStderrTo writer 2025-05-30 12:50:06 +00:00
client_integration_darwin_test.go fix lint issues 2019-08-30 17:04:37 +02:00
client_integration_linux_test.go New method Client.Extensions to list server extensions 2020-10-23 11:16:44 +02:00
client_integration_test.go address review set 2 2024-04-05 16:07:40 -04:00
client_test.go rework client to prevent after-close usage, and support perm at open 2024-01-19 00:20:23 +00:00
conn.go convert uses of uint8 instead of fxp to fxp 2025-05-30 13:30:46 +00:00
debug.go refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
errno_plan9.go address review set 2 2024-04-05 16:07:40 -04:00
errno_posix.go address review set 2 2024-04-05 16:07:40 -04:00
example_test.go Improve benchmarks and errors 2021-03-17 11:03:51 +00:00
fuzz.go refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
go.mod go get -u . 2025-08-21 12:17:34 +02:00
go.sum go mod tidy 2025-08-21 12:18:07 +02:00
ls_formatting.go Marshal extended data if file info supports it 2023-07-14 15:52:44 +02:00
ls_formatting_test.go Add support for zos/s390x 2024-04-04 16:26:47 -04:00
ls_plan9.go refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
ls_stub.go refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
ls_unix.go try support zos s390x 2024-03-15 01:07:06 +00:00
match.go Fix Glob handling of backslashes 2021-03-15 18:11:02 +01:00
packet-manager.go refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
packet-manager_test.go MarshalBinary now gives a 4-byte header for length, marshalPacket gives a two-stage write 2021-02-22 12:04:43 +00:00
packet-typing.go refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
packet.go rework recv debug messages to be context-added errors 2025-05-30 14:00:15 +00:00
packet_test.go convert uses of uint8 instead of fxp to fxp 2025-05-30 13:30:46 +00:00
pool.go actually, why not a better safe-guard 2021-07-02 08:49:51 +00:00
release.go refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
request-attrs.go address code review 2024-01-19 01:23:22 +00:00
request-attrs_test.go address code review 2024-01-19 01:23:22 +00:00
request-errors.go Lowercase error messages 2021-03-20 20:35:04 +01:00
request-example.go request-server: Introduce ReadlinkFileLister 2022-10-14 17:17:08 +02:00
request-interfaces.go request server: call Close() on ListerAt if it implements io.Closer 2024-02-14 11:48:40 +01:00
request-plan9.go refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
request-readme.md refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
request-server.go convert uses of uint8 instead of fxp to fxp 2025-05-30 13:30:46 +00:00
request-server_test.go Merge pull request #577 from drakkan/lister-close 2024-04-10 08:35:31 +02:00
request-unix.go refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
request.go Add WithMaxTxPacket server option 2024-04-26 09:04:33 +02:00
request_test.go Add WithMaxTxPacket server option 2024-04-26 09:04:33 +02:00
request_windows.go Refactor tests and make `toLocalPath` a method on `Server` 2022-10-18 18:17:45 +03:00
server.go convert uses of uint8 instead of fxp to fxp 2025-05-30 13:30:46 +00:00
server_integration_test.go address code review 2024-01-19 01:23:22 +00:00
server_nowindows_test.go Fix PR comments (build tags, %q) 2022-10-18 19:36:12 +03:00
server_plan9.go Fix PR comments (build tags, %q) 2022-10-18 19:36:12 +03:00
server_posix.go windows root: add stat for '/' 2025-01-01 16:23:02 +01:00
server_statvfs_darwin.go add serverside StatVFS function, implemented for darwin and linux (#89) 2016-06-13 14:45:13 +10:00
server_statvfs_impl.go refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
server_statvfs_linux.go refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
server_statvfs_plan9.go pointer receivers and statusFromError(uint32, error) 2021-02-22 12:11:42 +00:00
server_statvfs_stubs.go refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
server_test.go Add support for zos/s390x 2024-04-04 16:26:47 -04:00
server_unix.go Refactor tests and make `toLocalPath` a method on `Server` 2022-10-18 18:17:45 +03:00
server_windows.go review adjustments 2025-01-02 20:15:18 +01:00
server_windows_test.go Fix PR comments (build tags, %q) 2022-10-18 19:36:12 +03:00
sftp.go convert uses of uint8 instead of fxp to fxp 2025-05-30 13:30:46 +00:00
sftp_test.go statusFromError: improve support for error wrapping 2022-12-25 17:21:42 +01:00
stat.go Update the S_IFMT godoc. 2024-04-08 18:34:16 +00:00

README.md

sftp

The sftp package provides support for file system operations on remote ssh servers using the SFTP subsystem. It also implements an SFTP server for serving files from the filesystem.

CI Status Go Reference

usage and examples

See https://pkg.go.dev/github.com/pkg/sftp for examples and usage.

The basic operation of the package mirrors the facilities of the os package.

The Walker interface for directory traversal is heavily inspired by Keith Rarick's fs package.

roadmap

  • There is way too much duplication in the Client methods. If there was an unmarshal(interface{}) method this would reduce a heap of the duplication.

contributing

We welcome pull requests, bug fixes and issue reports.

Before proposing a large change, first please discuss your change by raising an issue.

For API/code bugs, please include a small, self contained code example to reproduce the issue. For pull requests, remember test coverage.

We try to handle issues and pull requests with a 0 open philosophy. That means we will try to address the submission as soon as possible and will work toward a resolution. If progress can no longer be made (eg. unreproducible bug) or stops (eg. unresponsive submitter), we will close the bug.

Thanks.