aboutsummaryrefslogtreecommitdiff
path: root/ssh/session.go
AgeCommit message (Collapse)Author
2026-03-27ssh: implement Session Run with contextShulhan
The RunWithContext similar to Run but terminate the remote command with SIGKILL when its receive context cancellation.
2022-09-19all: replace io/ioutil with io and os packagecui fliter
For golang/go#45557 Change-Id: I447530cc66896aef7a8d528ccb8d095b80e3cf47 GitHub-Last-Rev: 5f385ff46487ac318bd1147cdbbd26bb0ffd0426 GitHub-Pull-Request: golang/crypto#230 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/430797 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Meng Zhuo <mzh@golangcn.org> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-03-13ssh: add IUTF8 constant from RFC 8160Brad Fitzpatrick
Change-Id: I65ac40d86c4f0ee5552cd2e167ac91a735f6c56e Reviewed-on: https://go-review.googlesource.com/c/crypto/+/392134 Trust: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Maisem Ali <maisem@tailscale.com>
2017-11-28all: run gofmt -s on source codeKevin Burke
Per the description, the "-s" file issues slight simplifications to the source code. Change-Id: I77395d763f5eafb48653902dcedfa56b150b2d67 Reviewed-on: https://go-review.googlesource.com/80138 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-26ssh: add Session.WindowChange to send window change eventsTobias Assarsson
Change-Id: Ib89c0a4e46c9a7f90a53f21b06fcddfdf13c7fd9 Reviewed-on: https://go-review.googlesource.com/50490 Reviewed-by: Han-Wen Nienhuys <hanwen@google.com> Run-TryBot: Han-Wen Nienhuys <hanwen@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-07-06x/crypto/ssh: handle missing exit status more gracefully.Han-Wen Nienhuys
According to RFC 4254 section 6.10, SSH server implementations may omit the exit-status and exit-signal messages. If this happens, we now return &ExitMissingError{}, so clients can handle this case specifically. This came up in the discussion of issue #16194. Change-Id: Iae5e916b18aa5bd8e95618e9fcfcab8b19e147d9 Reviewed-on: https://go-review.googlesource.com/24727 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Han-Wen Nienhuys <hanwen@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-07-06x/crypto/ssh: use BigEndian.Uint32 for decoding exit status.Han-Wen Nienhuys
Change-Id: Iab40fe42454088a00abea61dfb6f368da9323eb3 Reviewed-on: https://go-review.googlesource.com/24726 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Han-Wen Nienhuys <hanwen@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-04-20x/crypto/ssh: omit empty fields in error messageScott Bell
Although the signal and msg fields are assigned together, their values originate from the remote server and may be empty. Fixes golang/go#14251 Change-Id: I9d9094cc69f3c14bf1648af59951f6b6c7a71e0a Reviewed-on: https://go-review.googlesource.com/22196 Reviewed-by: Han-Wen Nienhuys <hanwen@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-11-15crypto/ssh: fix typo in error string.Jonathan Boulle
cound -> could Also change fmt.Errorf -> errors.New for consistency. Change-Id: I0b6900a76b70cd37ab2e8d61327868b46366ec64 Reviewed-on: https://go-review.googlesource.com/11235 Reviewed-by: Adam Langley <agl@golang.org>
2014-04-09go.crypto/ssh: import gosshnew.Adam Langley
See https://groups.google.com/d/msg/Golang-nuts/AoVxQ4bB5XQ/i8kpMxdbVlEJ R=hanwen CC=golang-codereviews https://golang.org/cl/86190043
2013-11-01go.crypto/ssh: Increase window size.Jakob Borg
Increase window size for channels (session and tcpip) to 64 * max packet size (32 KB), which is the same value that OpenSSH uses. Also breaks out the relevant harcoded constants into named constants in channel.go. Fixes golang/go#6675. R=golang-dev, dave, hanwen, agl CC=golang-dev https://golang.org/cl/18120043
2013-10-25go.crypto/ssh: ensure {Server,Client}Conn do not expose io.ReadWriterDave Cheney
Transport should not be a ReadWriter. It can only write packets, i.e. no partial reads or writes. Furthermore, you can currently do ClientConn.Write() while the connection is live, which sends raw bytes over the connection. Doing so will confuse the transports because the data is not encrypted. As a consequence, ClientConn and ServerConn stop being a net.Conn Finally, ensure that {Server,Client}Conn implement LocalAddr and RemoteAddr methods that previously were exposed by an embedded net.Conn field. R=hanwen CC=golang-dev https://golang.org/cl/16610043
2013-10-10go.crypto/ssh: cosmetic only spelling fixesJonathan Pittman
R=agl, hanwen CC=dave, golang-dev, jpsugar https://golang.org/cl/14430055
2013-05-29ssh: add Output and CombinedOutput helpersKeith Rarick
R=golang-dev, dave CC=golang-dev https://golang.org/cl/9711043
2012-12-18go.crypto/ssh: support OpenSSH keepalivesEric Milliken
Fixes golang/go#4552. R=minux.ma, agl CC=golang-dev https://golang.org/cl/6948059
2012-12-10go.crypto/ssh: run gofmtAdam Langley
gofmt got better at removing trailing whitespace. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6929044
2012-10-21go.crypto/ssh: add terminal modes to ssh.RequestPty()Willem van der Schyff
R=dave, agl CC=golang-dev https://golang.org/cl/6655046
2012-08-24go.crypto/ssh: prevent channel writes after CloseDave Cheney
Fixes golang/go#3810. This change introduces an atomic boolean to guard the close of the clientChan. Previously the client code was quite lax with the ordering of the close messages and could allow window adjustment or EOF messages to leak after Close had been signaled. Consolidating the changes to the serverChan will be handled in a following CL. R=agl, kardianos, gustav.paul CC=golang-dev https://golang.org/cl/6405064
2012-06-18ssh: added RequestSubsystem().Christine Hansmann
RequestSubsystem requests the association of a subsystem with the ssh session on the remote host. A subsystem is a predefined command that runs in the background when the ssh session is initiated (i.e. sftp). R=golang-dev, agl CC=golang-dev, gustav.paul https://golang.org/cl/6295096
2012-05-05go.crypto/ssh: struct renamingDave Cheney
This CL is in preparation for 6128059. * rename channel -> serverChan * rename chanlist -> chanList * normalise theirId/MyId/id/peersId -> localId/remoteId R=agl CC=golang-dev https://golang.org/cl/6174046
2012-04-20ssh: cosmetic cleanupsAdam Langley
These are the cosmetic cleanups from the bits of code that I rereviewed. 1) stringLength now takes a int; the length of the string. Too many callers were allocating with stringLength([]byte(s)) and stringLength only needs to call len(). 2) agent.go now has sendAndReceive to remove logic that was duplicated. 3) We now reject negative DH values 4) We now reject empty packets rather than crashing. R=dave, jonathan.mark.pittman CC=golang-dev https://golang.org/cl/6061052
2012-01-25go.crypto: initial codeRuss Cox
Manual edits to README. Moved from main Go repository, deleted Makefiles, ran gofix -r go1rename. Tested with: go test code.google.com/p/go.crypto/... R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5564059