golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.86k stars 17.65k forks source link

x/build: unify gomote push and gomote ssh users #23043

Open randall77 opened 6 years ago

randall77 commented 6 years ago

When I "gomote push" to a gomote host, it writes all of the files and directories it copies over as user "root". When I "gomote ssh", it logs me in as "gopher". At that point, I don't have permissions to modify any of the files or directories, so things like all.bash don't work when it tries to write anything.

$ ./all.bash
Building Go cmd/dist using /tmp/workdir/go1.4.
go install _/tmp/workdir/go/src/cmd/dist: open cmd/dist/dist: permission denied

At least, this is true on openbsd-amd64.

It would also be nice to set GOROOT_BOOTSTRAP to /tmp/workdir/go1.4 when ssh-ing in. But only if it was already gomote pushed?

@bradfitz

bradfitz commented 6 years ago

Thanks for the bug report. I'll try to make this easier and more painless.

Or at least I'll make its intro banner tell you what to do, if it can't do it itself.

For OpenBSD, IIRC, you can run "su" to use password "root" to get root. Then cd to $WORKDIR which it tells you. Probably /tmp/workdir.

randall77 commented 6 years ago

Yeah, I worked around it by doing cp -r /tmp/workdir /tmp/workdir2 and using workdir2 instead.

randall77 commented 6 years ago

su root with password root does work.

bradfitz commented 6 years ago

/cc @dmitshur