cyberz.org

September 7, 2008

Using samba with autofs on Fedora 9

Filed under: News — Tags: , — andrea @ 3:55 pm

Mount a samba share on the fly without having it mounted statically at boot via the /etc/fstab file can bring you the advantage of an unpainful boot in case of unavailability of the samba server like in the following common scenarios:

  • laptop: you mount your pc share at home, but when you move it becomes unavailable
  • workstation: you mount the share of your workmate – but when he/she goes on holiday his/her workstation stays off

Using autofs this can be accomplished easily following these steps:

  1. Set /auto under the control of autofs adding this line to /etc/auto.master:

    /auto            /etc/auto.auto    --timeout=5 --ghost

  2. Point directory to a samba share //server/share in /etc/auto.auto:

    directory -fstype=cifs,credentials=/etc/smb.auth ://server/share (directory is a child directory of /auto)

  3. Store access credentials to the samba share in /etc/smb.auth:

    username=yourusername
    password=youpassword


  4. Secure the password file:

    # chmod 600 /etc/smb.auth

  5. Start autofs:

    # /etc/init.d/autofs start
    Starting automount: [ OK ]


No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Powered by WordPress