footloose icon indicating copy to clipboard operation
footloose copied to clipboard

Suggest to add "user" into Machine spec

Open brightzheng100 opened this issue 2 years ago • 1 comments

I found that the SSH pub key is hardcoded to be in /root/.ssh which indicates that the SSH user is actually root.

In this case, if I run footloose ssh without specifying the user, like footloose ssh root@host xxx, the user will be retrieved by current OS user, which doesn't make sense in most of the cases: https://github.com/weaveworks/footloose/blob/master/ssh.go#L37-L51

So I'd suggest to add a new element in Machine spec, with "root" as the default value, like this:

// Machine is a single machine.
type Machine struct {
	spec *config.Machine

	// container name.
	name string
	// container hostname.
	hostname string
	// container ip.
	ip string
	// container user, defaults to "root".
	user string

	runtimeNetworks []*RuntimeNetwork
	// Fields that are cached from the docker daemon.

	ports map[int]int
	// maps containerPort -> hostPort.
}

What do you think?

brightzheng100 avatar Jun 16 '22 04:06 brightzheng100

Hello, I am starting to work on this issue.

royadaneshi avatar May 12 '23 16:05 royadaneshi