VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: Accessing/mounting Samba shares automatically  (Read 2110 times)

Freeman

  • Tester
  • Vectorite
  • ****
  • Posts: 323
  • Choice to the user!
Accessing/mounting Samba shares automatically
« on: March 02, 2008, 02:34:26 am »

I used this line from our wonderful Howto section to mount a samba share on my Vectorlinuxbox:
Code: [Select]
/usr/bin/smbmount //winmachine-1/shared /path/dir -o username=user_name
Now I wanted to automate this process and looked at the link provided in the Howto. This was a script especially created to mount sambadrives. But still, isn't it possible to paste this line in /etc/fstab? The only thing I'm missing in this command is the possibility to enter automatically my password...

Any thoughts on this?

Thanks!
Freeman :)
Logged
It's better to die 10 times, than never to have loved at all.

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4085
Re: Accessing/mounting Samba shares automatically
« Reply #1 on: March 02, 2008, 05:15:20 am »

Here is how I do it:
I have a file ~/.smb/creds:
Code: [Select]
username=user
password=pass
The mount command is:
Code: [Select]
smbmount //computer/share /path/dir -o credentials=/home/user/.smb/creds
Problem with using fstab is that the network is not up by the time it is processed.
I call my mount command from KDE's Autostart folder.
You can also use /etc/rc.d/rc.local, but that one is run as root, which may cause some read-write issues.

Here is a guide on using ~/.bashrc: http://blog.unixlore.net/2006/05/accessing-windows-shares-from-gnulinux.html
« Last Edit: March 02, 2008, 05:22:41 am by nightflier »
Logged

Freeman

  • Tester
  • Vectorite
  • ****
  • Posts: 323
  • Choice to the user!
Re: Accessing/mounting Samba shares automatically
« Reply #2 on: March 04, 2008, 10:36:21 am »

Thanks Nightflier, that did the trick!
Logged
It's better to die 10 times, than never to have loved at all.