|
sshDir := path.Join(homeDir, groupname, username, ".ssh") |
The code above is how the .ssh/authorized_keys path is constructed. It assumes that the user's home directory follows the format of /home/{group_name}/{user_name} which is not always the case. It should be replaced by
import "os/user"
...
u, _ := user.Lookup(usename)
sshDir := path.Join(u.HomeDir, ".ssh")
hpc-webhook/internal/server/key.go
Line 114 in 070c4eb
The code above is how the
.ssh/authorized_keyspath is constructed. It assumes that the user's home directory follows the format of/home/{group_name}/{user_name}which is not always the case. It should be replaced by