autofs com o sshfs não funcionando mais [fechado]

8

Acabei de atualizar do Ubuntu 12.04 para o 12.10. Antes disso eu fiz o backup da minha configuração autofs que funcionou bem. Anexei a linha do meu antigo /etc/auto.master ao novo:

+dir:/etc/auto.master.d
+auto.master
/mnt /etc/auto.sshfs uid=1000,gid=1000,--timeout=30,--ghost,--verbose

my /etc/auto.sshfs tem esta aparência:

mymount -fstype=fuse,rw,nodev,nonempty,noatime,allow_other,max_read=65536 :sshfs\#myuser@mydomain:/mnt/mymount

Tentando isso manualmente, recebi Connetion reset by peer , então adicionei a opção IdentityFile=/home/myuser/.ssh/id_rsa . Agora isso acontece quando tento acessar /mnt (ambos com manual e autofs):

myuser@laptop /mnt % la
ls: cannot access mymount: No such file or directory
total 4
drwxr-xr-x  3 root root    0 Oct 19 10:34 ./
drwxr-xr-x 25 root root 4096 Oct 18 23:17 ../
d?????????  ? ?    ?       ?            ? mymount/

As entradas relevantes do meu /var/log/syslog são estas:

Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: lookup(program): lookup for mymount failed
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount
Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount
Oct 19 00:18:01 laptop automount[1250]: attempting to mount entry /mnt/.hidden
Oct 19 00:18:01 laptop automount[1250]: lookup(program): lookup for .hidden failed
Oct 19 00:18:01 laptop automount[1250]: failed to mount /mnt/.hidden
Oct 19 00:18:03 laptop automount[1250]: attempting to mount entry /mnt/.hidden
Oct 19 00:18:03 laptop automount[1250]: failed to mount /mnt/.hidden
Oct 19 00:18:03 laptop automount[1250]: attempting to mount entry /mnt/.hidden
Oct 19 00:18:03 laptop automount[1250]: failed to mount /mnt/.hidden
Oct 19 00:18:24 laptop automount[1250]: attempting to mount entry /mnt/.hidden
Oct 19 00:18:24 laptop automount[1250]: failed to mount /mnt/.hidden
Oct 19 00:21:57 laptop automount[1250]: umount_autofs_indirect: ask umount returned busy /mnt
Oct 19 00:21:59 laptop automount[1250]: shut down path /mnt
Oct 19 00:21:59 laptop automount[3436]: mounted indirect on /mnt with timeout 30, freq 8 seconds
Oct 19 00:21:59 laptop automount[3436]: ghosting enabled

Já verifiquei o UID e o GID e eles correspondem ao meu usuário. Chaves SSH para o meu usuário estão no lugar. Eu também tentei criar /mnt/mymount manualmente, mas estranhamente ele retorna "permissões negadas" mesmo como root enquanto o autofs está rodando (acho que deveria ser assim).

Alguma idéia do que pode estar errado? Deve haver uma etapa de configuração que esqueci o que fiz antes.

    
por André Stannek 19.10.2012 / 00:41

2 respostas

1

Existem algumas armadilhas que podem causar os problemas que você está enfrentando. No momento desta resposta, você já resolveu um deles, mas eu vou acertar todos eles (seu problema atual está sendo causado por # 3).

1 - O arquivo de identidade

Este é o que você resolveu. Ao executar sshfs de uma montagem autofs, sshfs é executado como o usuário root, portanto, ele usa a chave ssh do root por padrão. Você precisa especificar IdentityFile=/home/user/.ssh/id_rsa para usar uma chave diferente.

2 - hosts conhecidos

Além disso, como você está executando sshfs como um usuário diferente do que normalmente faz, é necessário certificar-se de que o host remoto que está montando esteja no arquivo known_hosts . Existem algumas maneiras de resolver esse problema.

  1. ssh para o host remoto uma vez como root e aceite a chave do host remoto.
  2. Adicione o parâmetro StrictHostKeyChecking=no . Isso fará com que o ssh aceite qualquer tecla que ele veja (portanto, introduz um pouco de insegurança).
  3. Adicione o parâmetro UserKnownHostsFile=/home/user/.ssh/known_hosts . Isso fará com que use o arquivo known_hosts de seu usuário normal.

3 - FUSE allow_other

Por padrão, um sistema de arquivos de fusíveis (que é o sshfs) não permite que usuários, além daquele que montou o sistema de arquivos, o acessem. Como o autofs é executado como root, por padrão, somente o root pode acessá-lo. Qualquer outra pessoa não terá permissões (mesmo que o root seja montado por um usuário não-root), mesmo que as permissões reais do arquivo digam que devem ser feitas. Para resolver isso, você precisa adicionar a opção de montagem allow_other . Isso permitirá que outros usuários, além daquele que o montou, acessem a montagem. Embora o acesso ainda obedecerá às permissões em nível de arquivo dos arquivos na montagem.

    
por 30.03.2013 / 21:16
0

Já tentou executar o autofs com opções de depuração?

sudo automount --debug -f /etc/auto.master fornecerá a saída de depuração ao terminal runnning.

Você adicionou root E seu usuário ao grupo de fusíveis?

sudo gpasswd -a $USER fuse

    
por 30.03.2013 / 20:29