@@ -37,15 +37,15 @@ testing.
3737
3838The simplest way of installing this plugin is by running the following:
3939
40- ``` bash
40+ ``` text
4141go install github.com/foxboron/ssh-tpm-agent/cmd/...@latest
4242```
4343
4444Alternatively download the [ pre-built binaries] ( https://github.com/Foxboron/ssh-tpm-agent/releases ) .
4545
4646# Usage
4747
48- ``` bash
48+ ``` text
4949# Create key
5050$ ssh-tpm-keygen
5151Generating a sealed public/private ecdsa key pair.
@@ -78,7 +78,7 @@ Alternatively, you can use the environment variable
7878
7979Useful if you want to back up the key to a remote secure storage while using the key day-to-day from the TPM.
8080
81- ```bash
81+ ``` text
8282# Create a key, or use an existing one
8383$ ssh-keygen -t ecdsa -f id_ecdsa
8484Generating public/private ecdsa key pair.
@@ -116,7 +116,7 @@ The key's randomart image is the color of television, tuned to a dead channel.
116116
117117Socket activated services allow you to start ` ssh-tpm-agent ` when it's needed by your system.
118118
119- ` ` ` bash
119+ ``` text
120120# Using the socket
121121$ ssh-tpm-agent --install-user-units
122122Installed /home/fox/.config/systemd/user/ssh-tpm-agent.socket
@@ -133,7 +133,7 @@ $ ssh git@github.com
133133
134134### Proxy support
135135
136- ` ` ` bash
136+ ``` text
137137# Start the usual ssh-agent
138138$ eval $(ssh-agent)
139139
@@ -175,7 +175,7 @@ ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNo[...]q4whro= ssh-tpm-agent
175175
176176### ssh-tpm-add
177177
178- ```bash
178+ ``` text
179179$ ssh-tpm-agent --no-load &
1801802023/08/12 13:40:50 Listening on /run/user/1000/ssh-tpm-agent.sock
181181
@@ -199,14 +199,14 @@ will use the owner hierarchy with an SRK.
199199The output file ` srk.pem ` needs to be transferred to the remote end which
200200creates the key. This could be done as part of client provisioning.
201201
202- ```bash
202+ ``` text
203203$ tpm2_createprimary -C o -G ecc -g sha256 -c prim.ctx -a 'restricted|decrypt|fixedtpm|fixedparent|sensitivedataorigin|userwithauth|noda' -f pem -o srk.pem
204204```
205205
206206On the remote end we create a p256 ssh key, with no password, and wrap it with
207207` ssh-tpm-keygen ` with the ` srk.pem ` from the client side.
208208
209- ```bash
209+ ``` text
210210$ ssh-keygen -t ecdsa -b 256 -N "" -f ./ecdsa.key
211211# OR with openssl
212212$ openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:prime256v1 -out ecdsa.key
@@ -217,7 +217,7 @@ $ ssh-tpm-keygen --wrap-with srk.pub --wrap ecdsa.key -f wrapped_id_ecdsa
217217
218218On the client side we can unwrap ` wrapped_id_ecdsa ` to a loadable key.
219219
220- ```bash
220+ ``` text
221221$ ssh-tpm-keygen --import ./wrapped_id_ecdsa.tpm -f id_ecdsa.tpm
222222$ ssh-tpm-add id_ecdsa.tpm
223223```
@@ -226,7 +226,7 @@ $ ssh-tpm-add id_ecdsa.tpm
226226
227227` ssh-tpm-agent ` also supports storing host keys inside the TPM.
228228
229- ```bash
229+ ``` text
230230$ sudo ssh-tpm-keygen -A
2312312023/09/03 17:03:08 INFO Generating new ECDSA host key
2322322023/09/03 17:03:08 INFO Wrote /etc/ssh/ssh_tpm_host_ecdsa_key.tpm
0 commit comments