Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions spread/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,20 @@ type Client struct {

func Dial(server Server, username, password string) (*Client, error) {
config := &ssh.ClientConfig{
User: username,
Auth: []ssh.AuthMethod{ssh.Password(password)},
User: username,
Auth: []ssh.AuthMethod{
ssh.Password(password),
ssh.KeyboardInteractive(func(user, instruction string, questions []string, echos []bool) ([]string, error) {
answers := make([]string, len(questions))
for i, _ := range questions {
if questions[i] == "Password: " {
answers[i] = password
}
Comment on lines +46 to +48
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this part driven by PAM?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume it is. Gentoo ships those override files in their images:

root@gentoo /etc/ssh/sshd_config.d # ls -la
total 12
drwxr-xr-x 2 root root 128 Jun 22 23:57 .
drwxr-xr-x 4 root root 291 Jul  1 07:17 ..
lrwxrwxrwx 1 root root  61 Jun 22 23:56 20-systemd-userdb.conf -> ../../../usr/lib/systemd/sshd_config.d/20-systemd-userdb.conf
-rw------- 1 root root 316 Jun  1 19:22 9999999gentoo.conf
-rw------- 1 root root 133 Jun  1 19:22 9999999gentoo-pam.conf
-rw------- 1 root root  79 Jun  1 19:22 9999999gentoo-subsystem.conf
root@gentoo /etc/ssh/sshd_config.d # cat 9999999gentoo*
# Allow client to pass locale environment variables (bug #367017)
AcceptEnv LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LANGUAGE LC_ADDRESS LC_IDENTIFICATION LC_MEASUREMENT LC_NAME LC_PAPER LC_TELEPHONE

# Allow client to pass COLORTERM to match TERM (bug #658540)
AcceptEnv COLORTERM
UsePAM yes
# This interferes with PAM.
PasswordAuthentication no
# PAM can do its own handling of MOTD.
PrintMotd no
PrintLastLog no
# override default of no subsystems
Subsystem	sftp	/usr/lib64/misc/sftp-server

}

return answers, nil
}),
},
Timeout: 10 * time.Second,
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
}
Expand Down
Loading