[olug] Automount cifs shares in Fedora FC2/FC3

Brandon Lederer brandon at tolkien-movies.com
Mon Nov 29 18:22:47 UTC 2004


Thats more secure and good to know......  but i just do this in fstab

//server/share   /mnt/share  smbfs 
nosuid,nodev,noexec,username=user,password=passwd,uid=500,gid=500,file_mode=0664,dir_mode=0755 
0 0

On Monday 29 November 2004 11:38 am, Jon H. Larsen wrote:
> Hi All,
>
> Here's a handy way to mount cifs (samba) shares on system bootup.
> I've done this is FC2 and FC3, YMMV in other distros.
>
> You'll need to edit fstab, so you should be comfortable with doing so.
>
> Login as root
>
> Create the file /etc/samba/auth.smb in your favorite text editor.
> In it, you should place the username and password for the share you plan
> to connect to.  It should look like this:
>
> username=myuserid
> password=mypasswd
>
> Save it.
>
> Protect it:
> chmod 600 /etc/samba/auth.smb
>
> This way, only root can read it.
>
> You can create a few /etc/samba/auth.smb.whatever if different machines
> have different userids/passwords.  Just reference the correct
> credentials=auth.* in /etc/fstab.
>
> Next, edit /etc/fstab.  Add a new line to the bottom of your /etc/fstab
> like to the line below (remember, this is all one line, but your email
> client will break the line, use other fstab entries as your guide):
>
> //server/share   /mnt/share  cifs
> nosuid,nodev,noexec,credentials=/etc/samba/auth.smb,uid=500,gid=500,file_mo
>de=0664,dir_mode=0755 0 0
>
> Change the uid and gid to match your own.  Mine are uid=500,gid=500, as
> I'm the only user on my box.
>
> Save it.
>
> Next, create the mount point
>
> mkdir /mnt/share
>
> Go into the Fedora init.d dir:
> cd /etc/rc.d/init.d/
>
> ./netfs restart
>
> You should see something close to this:
> Unmounting CIFS filesystems:                               [  OK  ]
> Mounting CIFS filesystems:                                 [  OK  ]
> Mounting other filesystems:                                [  OK  ]
>
> Make sure you add netfs to your runlevel startup.
>
> chkconfig --add netfs
>
> Now, your samba shares will mount each time you boot your system.
>
> Jon L.



More information about the OLUG mailing list