File tree 2 files changed +9
-6
lines changed
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ if [ ! -r $TEST_SSH_KEY_PATH ]; then
34
34
fi
35
35
36
36
# Read in the public key
37
- MOUNT_SSH_PUB_KEY_CONTENT=` cat $TEST_SSH_KEY_PATH `
37
+ MOUNT_SSH_PUB_KEY_CONTENT=` cat $TEST_SSH_KEY_PATH .pub `
38
38
39
39
# make the plugin
40
40
PLUGIN_TAG=$TAG make
@@ -44,13 +44,16 @@ docker plugin enable $SSH_MOUNT_PLUGIN
44
44
docker plugin ls
45
45
# start sshd
46
46
docker run -d -p $MOUNT_PORT :22 --name $SSH_MOUNT_CONTAINER $DOCKER_SSH_MOUNT_IMAGE
47
- # Copy in the public key
48
- docker exec -it $SSH_MOUNT_CONTAINER bash -c " echo $MOUNT_SSH_PUB_KEY_CONTENT >> $MOUNT_PATH /.ssh/authorized_keys"
49
-
50
47
# It takes a while for the container to start and be ready to accept connection
51
48
# TODO, check when container is ready instead of sleeping
52
49
sleep 20
53
50
51
+ # Copy in the public key
52
+ # Write a newline followed by the public key
53
+ # https://unix.stackexchange.com/questions/191694/how-to-put-a-newline-special-character-into-a-file-using-the-echo-command-and-re
54
+ docker exec -it $SSH_MOUNT_CONTAINER bash -c $" echo \n >> $MOUNT_PATH /.ssh/authorized_keys"
55
+ docker exec -it $SSH_MOUNT_CONTAINER bash -c " echo $MOUNT_SSH_PUB_KEY_CONTENT >> $MOUNT_PATH /.ssh/authorized_keys"
56
+
54
57
# test1: ssh key
55
58
docker plugin disable $SSH_MOUNT_PLUGIN
56
59
docker plugin set $SSH_MOUNT_PLUGIN sshkey.source=$TEST_SSH_KEY_DIRECTORY
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ docker plugin install ucphhpc/sshfs state.source=<any_folder> sshkey.source=/hom
61
61
62
62
2 - Create a volume
63
63
64
- > Make sure the *** source path on the ssh server was exists*** .
64
+ > Make sure the *** source path on the ssh server exists*** .
65
65
>
66
- > Or you'll be failed while use/mount the volume.
66
+ > Or you will fail when you use/mount the volume.
67
67
68
68
```
69
69
$ docker volume create -d ucphhpc/sshfs -o sshcmd=<user@host:path> [-o IdentityFile=/root/.ssh/<key>] [-o port=<port>] [-o <any_sshfs_-o_option> ] sshvolume
You can’t perform that action at this time.
0 commit comments