|
| 1 | +wolfssh |
| 2 | +======= |
| 3 | + |
| 4 | +wolfSSL's Embeddable SSH Server |
| 5 | + |
| 6 | +dependencies |
| 7 | +------------ |
| 8 | + |
| 9 | +wolfSSH is dependent on wolfCrypt. The simplest configuration of wolfSSL |
| 10 | +required for wolfSSH is the default build. |
| 11 | + |
| 12 | + $ cd wolfssl |
| 13 | + $ ./configure [OPTIONS] --enable-ssh |
| 14 | + $ make check |
| 15 | + $ sudo make install |
| 16 | + |
| 17 | +To use the key generation function in wolfSSH, wolfSSL will need to be |
| 18 | +configured with keygen: `--enable-keygen`. |
| 19 | + |
| 20 | +If the bulk of wolfSSL code isn't desired, wolfSSL can be configured with |
| 21 | +the crypto only option: `--enable-cryptonly`. |
| 22 | + |
| 23 | + |
| 24 | +building |
| 25 | +-------- |
| 26 | + |
| 27 | +From the source directory run: |
| 28 | + |
| 29 | + $ ./autogen.sh |
| 30 | + $ ./configure |
| 31 | + $ make |
| 32 | + $ make check |
| 33 | + |
| 34 | +The `autogen.sh` script only has to be run the first time after cloning the |
| 35 | +repository. If you have already run it or are using code from a source |
| 36 | +archive, you should skip it. |
| 37 | + |
| 38 | +For building under Windows with Visual Studio, see the file |
| 39 | +"ide/winvs/README.md". |
| 40 | + |
| 41 | +NOTE: On resource constrained devices the DEFAULT_WINDOW_SZ may need to be set |
| 42 | +to a lower size. By default channels are set to handle 1 Mb of data being sent |
| 43 | +and received. An example of setting a lower window size for new channels would |
| 44 | +be as follows "./configure CPPFLAGS=-DDEFAULT_WINDOW_SZ=16384" |
| 45 | + |
| 46 | +examples |
| 47 | +-------- |
| 48 | + |
| 49 | +The directory `examples` contains an echoserver that any client should be able |
| 50 | +to connect to. From the terminal run: |
| 51 | + |
| 52 | + $ ./examples/echoserver/echoserver |
| 53 | + |
| 54 | +From another terminal run: |
| 55 | + |
| 56 | + $ ssh_client localhost -p 22222 |
| 57 | + |
| 58 | +The server will send a canned banner to the client: |
| 59 | + |
| 60 | + wolfSSH Example Echo Server |
| 61 | + |
| 62 | +Characters typed into the client will be echoed to the screen by the server. |
| 63 | +If the characters are echoed twice, the client has local echo enabled. The |
| 64 | +echo server isn't being a proper terminal so the CR/LF translation will not |
| 65 | +work as expected. |
| 66 | + |
| 67 | + |
| 68 | +testing notes |
| 69 | +------------- |
| 70 | + |
| 71 | +After cloning the repository, be sure to make the testing private keys read- |
| 72 | +only for the user, otherwise ssh_client will tell you to do it. |
| 73 | + |
| 74 | + $ chmod 0600 ./keys/gretel-key-rsa.pem ./keys/hansel-key-rsa.pem \ |
| 75 | + ./keys/gretel-key-ecc.pem ./keys/hansel-key-ecc.pem |
| 76 | + |
| 77 | +Authentication against the example echoserver can be done with a password or |
| 78 | +public key. To use a password the command line: |
| 79 | + |
| 80 | + $ ssh_client -p 22222 USER@localhost |
| 81 | + |
| 82 | +Where the `USER` and password pairs are: |
| 83 | + |
| 84 | + jill:upthehill |
| 85 | + jack:fetchapail |
| 86 | + |
| 87 | +To use public key authentication use the command line: |
| 88 | + |
| 89 | + $ ssh_client -i ./keys/key-USER.pem -p 22222 USER@localhost |
| 90 | + |
| 91 | +Where the user can be `gretel` or `hansel`. |
| 92 | + |
| 93 | + |
| 94 | +scp support |
| 95 | +----------- |
| 96 | + |
| 97 | +wolfSSH includes server-side support for scp, which includes support for both |
| 98 | +copying files 'to' the server, and copying files 'from' the server. Both |
| 99 | +single file and recursive directory copy are supported with the default |
| 100 | +send and receive callbacks. |
| 101 | + |
| 102 | +To compile wolfSSH with scp support, use the `--enable-scp` build option |
| 103 | +or define `WOLFSSL_SCP`: |
| 104 | + |
| 105 | + $ ./configure --enable-scp |
| 106 | + $ make |
| 107 | + |
| 108 | +For full API usage and implementation details, please see the wolfSSH User |
| 109 | +Manual. |
| 110 | + |
| 111 | +The wolfSSL example server has been set up to accept a single scp request, |
| 112 | +and is compiled by default when compiling the wolfSSH library. To start the |
| 113 | +example server, run: |
| 114 | + |
| 115 | + $ ./examples/server/server |
| 116 | + |
| 117 | +Standard scp commands can be used on the client side. The following are a |
| 118 | +few examples, where `scp` represents the ssh client you are using. |
| 119 | + |
| 120 | +To copy a single file TO the server, using the default example user "jill": |
| 121 | + |
| 122 | + $ scp -P 22222 <local_file> jill@127.0.0.1:<remote_path> |
| 123 | + |
| 124 | +To copy the same single file TO the server, but with timestamp and in |
| 125 | +verbose mode: |
| 126 | + |
| 127 | + $ scp -v -p -P 22222 <local_file> jill@127.0.0.1:<remote_path> |
| 128 | + |
| 129 | +To recursively copy a directory TO the server: |
| 130 | + |
| 131 | + $ scp -P 22222 -r <local_dir> jill@127.0.0.1:<remote_dir> |
| 132 | + |
| 133 | +To copy a single file FROM the server to the local client: |
| 134 | + |
| 135 | + $ scp -P 22222 jill@127.0.0.1:<remote_file> <local_path> |
| 136 | + |
| 137 | +To recursively copy a directory FROM the server to the local client: |
| 138 | + |
| 139 | + $ scp -P 22222 -r jill@127.0.0.1:<remote_dir> <local_path> |
| 140 | + |
0 commit comments