首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用indermediate和sshfs安装autofs

使用indermediate和sshfs安装autofs
EN

Ask Ubuntu用户
提问于 2021-02-03 11:15:25
回答 1查看 316关注 0票数 0

我有一台网关机(A)和最后一台机器(B)。我已经能够使用~/. ssh /config中的ProxyCommand通过A将ssh和sshfs用于机器B。我这样做是为了使登录不需要使用ssh-copy命令和两台机器的密码。这很好用,我可以用我的机器:

sshfs用户@B:/home/user mnt

现在我想使用autofs按需安装(我已经为机器A上的文件夹这样做了),但这似乎不起作用。在本例中,用于挂载的文件夹是/mnt。我尝试使用详细和调试选项运行automount,我看到了以下内容:

代码语言:javascript
复制
handle_packet: type = 3
handle_packet_missing_indirect: token 96, name folder, request pid 6296
attempting to mount entry /mnt/folder
lookup_mount: lookup(file): looking up folder
lookup_mount: lookup(file): folder -> -fstype=fuse,allow_other :sshfs\#user@B\:/home/user
parse_mount: parse(sun): expanded entry: -fstype=fuse,allow_other :sshfs\#user@B\:/home/user
parse_mount: parse(sun): gathered options: uid=1000,gid=1000,fstype=fuse,allow_other
parse_mount: parse(sun): dequote(":sshfs\#user@B\:/home/user") -> :sshfs#user@B:/home/user
parse_mount: parse(sun): core of entry: options=uid=1000,gid=1000,fstype=fuse,allow_other, loc=:sshfs#user@B:/home/user
sun_mount: parse(sun): mounting root /mnt, mountpoint folder, what sshfs#user@B:/home/user, fstype fuse, options uid=1000,gid=1000,allow_other
do_mount: sshfs#user@B:/home/user /mnt/folder type fuse options uid=1000,gid=1000,allow_other using module generic
mount_mount: mount(generic): calling mkdir_path /mnt/folder
mount_mount: mount(generic): calling mount -t fuse -o uid=1000,gid=1000,allow_other sshfs#user@B:/home/user /mnt/folder
st_expire: state 1 path /mnt
expire_proc: exp_proc = 139950775805696 path /mnt
expire_proc_indirect: expire /mnt/folder

注意:我注意到,当我尝试使用带有/mnt的sshfs作为安装点手动挂载时,我甚至不能使用sudo。

EN

回答 1

Ask Ubuntu用户

发布于 2021-02-03 11:29:25

我找到了发生这种事的原因。Automount需要与sudo一起运行,但是root中没有/root/..ssh/config中的代理设置,因此它无法访问机器B(因为它只能通过机器A访问)。一旦我用正确的行更新/root/.ssh/config (使用ProxyCommand)并使用sudo重新运行ssh-copy命令,我就能够让autofs正常工作。我不喜欢回答我自己的问题,但我不会删除它,而是留在这里,以防其他人发现答案有用,或者如果我错过了一个更优雅的解决方案。

票数 2
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1313246

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档