Top Poster
#1 ramon fincken 399
#2 Site admin 3
#3 Ber|Art 2
#4 braddmark 1
#5 accentmedia 1
#6 Xarzu 1
#7 pEcosespedex 1
#8 khadish 1
#9 moxxx 1
#10 nistelrock 1
[solution] Ubuntu: automatically connect and mount to windows shares



Rating : 4 / 5

 
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> Ubuntu
Beta
Want to be notified by email when this topic gets a reply?  
View previous topic :: View next topic  
Author Message
ramon fincken
Site's programmer

Get a free globally recognized avatar
It's free!


Joined: 03 Aug 2007
Posts: 399
Location: A'dam/Diemen, The Netherlands

PostPosted: Sat Dec 19, 2009 6:49 pm    Post subject: [solution] Ubuntu: automatically connect and mount to windows shares Reply with quote

Tutorial to auto mount any share, applied to Windows share.

This example will auto mount
//Windows_server_name/video_dir to my Ubunutu upon login at /mnt/videos

You may need to install Samba, smbfs and /or CIFS first:
https://help.ubuntu.com/community/Mount...ermanently
Code:
sudo apt-get install smbfs
sudo update-rc.d -f umountnfs.sh remove
sudo update-rc.d umountnfs.sh stop 15 0 6 .



  1. Make a Mount directory first
    Code:
    mkdir ~/mnt


    In order to have a share mounted automatically every time you reboot, you need to do the following:

  2. Open a shell as root

  3. Create a file containing your Windows/Samba user account details:
    Code:
    gedit /home/yourubuntuusername/.sambaautologin

    /home/yourubuntuusername is of course your own home folder containing your name

    ...it should contain two lines as follows:
    Code:
    username=share_username
    password=share_password


  4. Optional: Change the permissions on the file for security:
    Code:
    chmod 0600 /home/yourubuntuusername/.sambaautologin


  5. Now create a directory where you want to mount your share (e.g. /mnt/videos):

    Code:
    mkdir /mnt/videos


  6. Now edit the file system table (/etc/fstab) and add a line as follows: ( Make a backup first )

    Code:
    //Windows_server_name/video_dir   /mnt/videos   smbfs   credentials=/home/yourubuntuusername/.sambaautologin,rw,uid=bob   0   0

    ...where 'bob' is the non-root user you log into ubuntu with, 'Windows_server_name' is the name or address of the Windows machine and 'video_dir' is the name of the share. So if your Ubuntu login name = pete >
    Code:
    //Windows_server_name/video_dir   /mnt/video   smbfs   credentials=/home/yourubuntuusername/.sambaautologin,rw,uid=pete   0   0


  7. To mount the share now, just use the following command as root. It will mount automatically on subsequent reboots.

    Code:
    mount /mnt/videos


    Not working? Try to rewrite
    Code:
    //Windows_server_name/video_dir
    as:
    Code:
    //[ip_adres_of_windows_server]/video_dir

    and try to mount again.
    Solution about this hosts/ip problem: http://www.linuxquestions.org/questions...nt-437901/

Partially rewritten from:
https://help.ubuntu.com/community/SettingUpSamba

Read on:
http://www.arsgeek.com/2006/09/25/ubunt...dwritable/
http://www.cyberciti.biz/tips/how-to-mo...linux.html
Back to top
View user's profile Send private message Visit poster's website
Google adsense
Advertisement





PostPosted: Sat Dec 19, 2009 6:49 pm    Post subject: [solution] Ubuntu: automatically connect and mount to windows shares

Advertisement
Back to top
GravityForms
Advertisement





PostPosted: Sat Dec 19, 2009 6:49 pm    Post subject: [solution] Ubuntu: automatically connect and mount to windows shares

Advertisement
Gravity Forms Plugin for WordPress
Back to top
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> Ubuntu All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
General forums
The world of freelance
Programming
Other projects
Poll
I love gifts

Yes goodies and presents! [3]
No but I love polls ! [1]

Related google ads