Skip to content

Commit 9941807

Browse files
committed
Add option to run sshfs with idmap argument
It makes it possible to have user ID remapped between local and remote. Signed-off-by: Marek Pikuła <[email protected]>
1 parent 9f420df commit 9941807

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/sshocker/run.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ var (
4242
Usage: "enable sshfs nonempty",
4343
Value: false,
4444
},
45+
&cli.StringFlag{
46+
Name: "sshfs-idmap",
47+
Usage: "set sshfs idmap option",
48+
Value: "none",
49+
},
4550
&cli.StringFlag{
4651
Name: "driver",
4752
Usage: "SFTP server driver. \"builtin\" (legacy) or \"openssh-sftp-server\" (robust and secure, recommended), automatically chosen by default",
@@ -94,6 +99,7 @@ func runAction(clicontext *cli.Context) error {
9499
if clicontext.Bool("sshfs-nonempty") {
95100
sshfsAdditionalArgs = append(sshfsAdditionalArgs, "-o", "nonempty")
96101
}
102+
sshfsAdditionalArgs = append(sshfsAdditionalArgs, "-o", "idmap="+clicontext.String("sshfs-idmap"))
97103
x := &sshocker.Sshocker{
98104
SSHConfig: sshConfig,
99105
Host: host,

0 commit comments

Comments
 (0)