Choose style:

Author Topic: Persistent samba shares [SOLVED]  (Read 6556 times)

0 Members and 1 Guest are viewing this topic.

Offline rmcellig

  • Member
  • ***
  • Posts: 205
  • Karma: 13
  • New Forum User
    • View Profile
Persistent samba shares [SOLVED]
« on: April 04, 2014, 03:38:46 pm »
I'm running Peppermint 4 on two computers. I have my samba shares set up. At the moment I open up a pcmanfm window and go to Go-Network drives to open my shares. Is there a way to have my shares automatically load and be available even after a reboot so I don't always have to go to the Go menu and select Network Drives all the time?
« Last Edit: April 05, 2014, 02:28:33 pm by rmcellig »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25660
  • Karma: 2819
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Persistent samba shares
« Reply #1 on: April 04, 2014, 03:48:59 pm »
YES .. you'd want to auto-mount them through fstab.

Where are these shares ?

and do they require authentication ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline rmcellig

  • Member
  • ***
  • Posts: 205
  • Karma: 13
  • New Forum User
    • View Profile
Re: Persistent samba shares
« Reply #2 on: April 04, 2014, 04:31:01 pm »
What I do initially is type in my user password and then the password to me key logger only once. After that I can access the shares without authentication.

When you say where are these shares so you mean the exact path to the share?

Offline rmcellig

  • Member
  • ***
  • Posts: 205
  • Karma: 13
  • New Forum User
    • View Profile
Re: Persistent samba shares
« Reply #3 on: April 04, 2014, 04:33:47 pm »
I just came across this video on youtube:



Is this pretty much how you set it up?

All I need is the ip address of the computers I have shares on?

When I set up my shares, I set them up with my user name and password. Not quite sure exactly where to put all of the required information in the fstab file. I just want to make sure I am getting it right.

Thanks!
« Last Edit: April 04, 2014, 05:09:28 pm by PCNetSpec, Reason: to display the youtube video »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25660
  • Karma: 2819
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Persistent samba shares
« Reply #4 on: April 04, 2014, 04:38:19 pm »
What do you mean by key logger ?

At any point whist connecting to the shares on other computers are you required to enter a username and password ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline rmcellig

  • Member
  • ***
  • Posts: 205
  • Karma: 13
  • New Forum User
    • View Profile
Re: Persistent samba shares
« Reply #5 on: April 04, 2014, 04:50:37 pm »
I don't think I am using the right terminology. On the Mac side it's called the Keychain. It's a place where you keep all your passwords. Can't remember what it is called on the Linux side. I just updated my previous post.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25660
  • Karma: 2819
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Persistent samba shares
« Reply #6 on: April 04, 2014, 05:23:32 pm »
Yeah that kinda covers it

BUT

If you don't need to authenticate, there's no need for the credentials file .. so the fstab stanza wil be different.

If "smb://imac/sharename" works, then you don't need to enter the IP address (in fact if you're using dynamic IP's you DON'T want to use IP's as they'll change)

and lastly I think he mised out an important security step of making the credential file accessible by only root.



you've removed the paths to the share from an earlier posting .. can you say what they are again

eg.
smb://imac/sharename
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline rmcellig

  • Member
  • ***
  • Posts: 205
  • Karma: 13
  • New Forum User
    • View Profile
Re: Persistent samba shares
« Reply #7 on: April 04, 2014, 08:05:28 pm »
I tried these shares by pasting them in my Firefox browser. Works great!


The shares are:

smb://imac/cdlibrary

smb://imac/randymac

smb://pepp3/randy

smb://pepp3/passport

smb://nicole/drive1

smb://nicole/home





« Last Edit: April 04, 2014, 08:12:39 pm by rmcellig »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25660
  • Karma: 2819
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Persistent samba shares
« Reply #8 on: April 04, 2014, 08:20:22 pm »
OK, let's try mounting a single share and then we'll move on

First create a mountpoint for the mount:
Code: [Select]
sudo mkdir -v /media/imac/cdlibrary
now what happens if you run:
Code: [Select]
sudo mount.cifs //imac/cdlibrary /media/imac/cdlibrary
are you prompted for a username/password, or does it just dump you back at an $ prompt ?

If it dumps you at an $ prompt .. try opening file manager, is cdlibrary listed in the left hand coulmn ? and does it contain the contents you expected ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline rmcellig

  • Member
  • ***
  • Posts: 205
  • Karma: 13
  • New Forum User
    • View Profile
Re: Persistent samba shares
« Reply #9 on: April 04, 2014, 08:32:39 pm »
After creating the directory, this is what I get.


Code: [Select]
randy@petty ~ $ sudo mkdir -v /media/imac/cdlibrary
mkdir: cannot create directory ‘/media/imac/cdlibrary’: File exists
randy@petty ~ $ sudo mount.cifs //imac/cdlibrary /media/imac/cdlibrary
sudo: mount.cifs: command not found
randy@petty ~ $


Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25660
  • Karma: 2819
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Persistent samba shares
« Reply #10 on: April 04, 2014, 09:24:08 pm »
OK, first you're gonna need to install cifs-utils:
Code: [Select]
sudo apt-get install cifs-utils
Now REBOOT

Once rebooted, do nothing that might  mount any shares .. just post the output (if any) from:
Code: [Select]
ls -a /media/imac/cdlibrary
and
Code: [Select]
mount

BTW, if a command gives an error it's normally best to stop and post the error rather than carrying on with the next command ;)
« Last Edit: April 04, 2014, 09:30:54 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline rmcellig

  • Member
  • ***
  • Posts: 205
  • Karma: 13
  • New Forum User
    • View Profile
Re: Persistent samba shares
« Reply #11 on: April 05, 2014, 08:36:52 am »
First off, thanks so much for the advice in your last post. Really appreciate that.

Here is my output as requested:

Code: [Select]
randy@petty ~ $ ls -a /media/imac/cdlibrary
.  ..
randy@petty ~ $ mount
/dev/sda12 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
gvfsd-fuse on /run/user/randy/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=randy)
/dev/sdc1 on /media/randy/stuff type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
/dev/sdb1 on /media/randy/STUFF3 type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
randy@petty ~ $


Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25660
  • Karma: 2819
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Persistent samba shares
« Reply #12 on: April 05, 2014, 01:52:28 pm »
OK, reboot again, and do nothing that might mount the share .. just open a terminal and run:
Code: [Select]
sudo mount.cifs //imac/cdlibrary /media/imac/cdlibrary
are you prompted for a username/password, or does it just dump you back at an $ prompt ?

If it dumps you at an $ prompt .. try opening file manager, is cdlibrary listed in the left hand coulmn ? and does it contain the contents you expected ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline rmcellig

  • Member
  • ***
  • Posts: 205
  • Karma: 13
  • New Forum User
    • View Profile
Re: Persistent samba shares
« Reply #13 on: April 05, 2014, 02:28:03 pm »
One thing I just noticed and it works fine even after a system reboot, is to open a file manager window. Go to Go-Network Drives and select a share. When I bookmarked the share to the left hand side of the File Manager Window, and rebooted my machine, I just click on the share and it opens. No problems at all. I renamed the bookmarked shares so I know what they are and all is well. Initially I am prompted for a user/password, so I enter them and when prompted, enter my keyring password so that the share password is stored forever. That's it.

I tried several reboots of my machine and it works every time. I can see and access all the shares on my LAN. Pretty cool. So I don't have to always go to Go-Network drives every time. They are always available along the left side of any PCManFM window. I guess I will mark this thread as solved and I want to thank you again for all of your help!!!

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25660
  • Karma: 2819
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Persistent samba shares [SOLVED]
« Reply #14 on: April 05, 2014, 03:34:43 pm »
Yeah that works, but they aren't being automounted .. and you may find some weird issues opening certain file types.

But gimme a shout if you have any weird issues like that.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec