-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
E-951: new command scp-help
: teaches people how to use scp
#151
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package croc | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
const scpHelp = ` | ||
----Summary---- | ||
The built-in scp command, available as part of the POSIX standard, can be used to securely copy files between your local machine | ||
and a runpod instance you already have SSH access to. | ||
|
||
This is not part of runpodctl - we provide this documentation for your convenience only. | ||
|
||
Linux, MacOS, and Windows 10 all come with scp pre-installed. | ||
|
||
--- Quick Start ----- | ||
The following quick-start guide: obtained via the tldr.sh project under the MIT license, provides a brief overview of how to use scp. https://tldr.sh/ | ||
|
||
Secure copy. | ||
Copy files between hosts using Secure Copy Protocol over SSH. | ||
More information: <https://man.openbsd.org/scp>. | ||
|
||
Copy a local file to a remote host: | ||
|
||
scp path/to/local_file remote_host:path/to/remote_file | ||
|
||
Use a specific port when connecting to the remote host: | ||
|
||
scp -P port path/to/local_file remote_host:path/to/remote_file | ||
|
||
Copy a file from a remote host to a local directory: | ||
|
||
scp remote_host:path/to/remote_file path/to/local_directory | ||
|
||
Recursively copy the contents of a directory from a remote host to a local directory: | ||
|
||
scp -r remote_host:path/to/remote_directory path/to/local_directory | ||
|
||
Copy a file between two remote hosts transferring through the local host: | ||
|
||
scp -3 host1:path/to/remote_file host2:path/to/remote_directory | ||
|
||
Use a specific username when connecting to the remote host: | ||
|
||
scp path/to/local_file remote_username@remote_host:path/to/remote_directory | ||
|
||
Use a specific SSH private key for authentication with the remote host: | ||
|
||
scp -i ~/.ssh/private_key path/to/local_file remote_host:path/to/remote_file | ||
|
||
Use a specific proxy when connecting to the remote host: | ||
|
||
scp -J proxy_username@proxy_host path/to/local_file remote_host:path/to/remote_file` | ||
|
||
var SCPHelp = &cobra.Command{ | ||
Use: "scp-help", | ||
Short: "help for using scp (secure copy over SSH)", | ||
Args: cobra.NoArgs, | ||
Run: func(cmd *cobra.Command, args []string) { fmt.Println(scpHelp) }, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer necessary (and in fact reduces the randomness rather than enhancing it in
go >= 1.22
: https://go.dev/blog/chacha8rand