LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-11-2014, 06:48 PM   #1
frushiyama
Member
 
Registered: Oct 2010
Location: Brazil, SP - Cosmópolis
Distribution: Slackware
Posts: 165

Rep: Reputation: 28
Mount samba share on Slackware: mount error(6) from mount.cifs


I have a Raspberry model B running Slackware ARM and sharing folders to windows machines using samba.
Here is the /etc/samba/smb.conf from the server:
Code:
[global]
   workgroup = WORKGROUP
   server string = RPI
   server role = standalone server
   hosts allow = 192.168.1. 127.
   log file = /var/log/samba.%m
   max log size = 50
[printers]
   comment = All Printers
   path = /var/spool/samba
   browseable = no
   guest ok = no
   writable = no
   printable = yes
[familia]
comment = Acesso Restrito a familia
path = /samba/familia
public = no
writable = yes
valid users = @familia, root
force group = familia
veto files = *.exe/*.com/*. scr/*.ace*.cab/*.bat/*.inf/
This share is working under Windows 7 OS, but when i tried to mount these share on other Slackware64 machine is showing this error:
Code:
~# mount -t cifs //192.168.1.106/samba/familia /home/francis/familia/ -o username=real_ushiyama,password=*****                                                             
Retrying with upper case share name                                                                                                                                                            
mount error(6): No such device or address                                                                                                                                                      
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
I need to do something on the host side or add some line on smb.conf from server? Samba service is not running on Slackware host, it is needed?

Last edited by frushiyama; 12-14-2014 at 04:44 PM.
 
Old 12-11-2014, 06:54 PM   #2
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,213

Rep: Reputation: 1433Reputation: 1433Reputation: 1433Reputation: 1433Reputation: 1433Reputation: 1433Reputation: 1433Reputation: 1433Reputation: 1433Reputation: 1433
it should be //192.168.1.106/familia
 
1 members found this post helpful.
Old 12-11-2014, 06:55 PM   #3
Gnisho
Member
 
Registered: Aug 2012
Location: Phoenix, AZ
Distribution: Slackware
Posts: 37

Rep: Reputation: Disabled
Path issue?

The share name in brackets should be all that the client cares about.

Instead of
mount -t cifs //192.168.1.106/samba/familia /home/francis/familia/ -o username=real_ushiyama,password=*****

Try
mount -t cifs //192.168.1.106/familia /home/francis/familia/ -o username=real_ushiyama,password=*****

?
 
1 members found this post helpful.
Old 12-11-2014, 07:06 PM   #4
frushiyama
Member
 
Registered: Oct 2010
Location: Brazil, SP - Cosmópolis
Distribution: Slackware
Posts: 165

Original Poster
Rep: Reputation: 28
It worked!
But only root can acess.
How can i acess these share from a regular user from host?

Last edited by frushiyama; 12-11-2014 at 07:21 PM.
 
Old 12-12-2014, 07:12 AM   #5
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 7,390

Rep: Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083
You would need to mount them with additional options. You can set an fmask and dmask for files and directories. The following would give owner rwx and group and others r-x. If you want everyone to have read/write access, change them to all 0s. Keep in mind, this will set every directory with those permissions, so, if you have 0000, any user is able to modify anything in those directories, including files from others.

Code:
mount -t cifs //192.168.1.106/familia /home/francis/familia/ -o username=real_ushiyama,password=*****,fmask=0022,dmask=0022
 
1 members found this post helpful.
Old 12-12-2014, 07:43 AM   #6
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Brú na Bóinne, IE
Distribution: Slackware, NetBSD
Posts: 1,777

Rep: Reputation: 1286Reputation: 1286Reputation: 1286Reputation: 1286Reputation: 1286Reputation: 1286Reputation: 1286Reputation: 1286Reputation: 1286
Quote:
Originally Posted by frushiyama View Post
I have a Raspberry model B running Slackware ARM and sharing folders to windows machines using samba.
Here is the /etc/samba/smb.conf from the server:
Code:
[[global]
   workgroup = WORKGROUP
Should there be two brackets before global?
 
1 members found this post helpful.
Old 12-13-2014, 04:45 AM   #7
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 14.2 + Multilib
Posts: 1,484

Rep: Reputation: 921Reputation: 921Reputation: 921Reputation: 921Reputation: 921Reputation: 921Reputation: 921Reputation: 921
Samba Credentials

In addition to most of the above, I always use a credentials file.

The credentials= option keeps the password out of the process table and out of the world-readable /etc/fstab should you later decide to go that route.

1. log in as root, create a /root/.smbcred file :

Code:
touch /root/.smbcred
chmod 600 /root/.smbcred
vi /root/.smbcred
Contents of /root/.smbcred ( one can also optionally add a domain=DDDDDDDD ):
Code:
username=real_ushiyama
password=PPPPPPPP
2. double-check permissions on /root/.smbcred
Code:
ls -la /root/.smbcred
it should look like this:
Code:
-rw-------   1 root root    42 Oct  8  2013 .smbcred
3. change the mount command:

Code:
mount -t cifs //192.168.1.106/familia /home/francis/familia/ -o "rw,uid=francis,forceuid,dir_mode=0022,file_mode=0022,credentials=/root/.smbcred"
I assume that only `francis` needs to access the [familia] share ?

Note that the location of /root/.smbcred assumes you'll be mounting /home/francis/familia/ as root ...

If `francis` is allowed to run the mount command, then move /root/.smbcred to /home/francis/.smbcred, change the owner to francis and change the mount command:

Code:
ls -la /home/francis/.smbcred
-rw-------   1 francis users    42 Oct  8  2013 .smbcred

mount -t cifs //192.168.1.106/familia /home/francis/familia/ -o "rw,uid=francis,forceuid,dir_mode=0022,file_mode=0022,credentials=/home/francis/.smbcred"
HTH.

-- kjh
 
1 members found this post helpful.
Old 12-14-2014, 06:34 PM   #8
frushiyama
Member
 
Registered: Oct 2010
Location: Brazil, SP - Cosmópolis
Distribution: Slackware
Posts: 165

Original Poster
Rep: Reputation: 28
I need acess only to the user "francis".
The brackets was a typo, sorry.
I can mount and see with:
Code:
mount -t cifs //192.168.1.106/familia /home/francis/familia/ -o "rw,uid=francis,forceuid,dir_mode=0000,file_mode=0000,credentials=/root/.smbcred"
But still no RW acess.
This make me think i still need to do something on server side.

Last edited by frushiyama; 12-15-2014 at 10:51 AM.
 
Old 12-15-2014, 09:40 AM   #9
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 7,390

Rep: Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083
Try removing some of the restrictions on the conf file to see if that is what's causing the problem. A simple 4 lines per share on mine gives me complete read/write access.

Code:
[familia]
  path = "/samba/familia"
  readonly = No
  create mask = 0777
  directory mask = 0777
You can rename this to familia2 to keep your current configuration in place.
 
1 members found this post helpful.
Old 12-15-2014, 03:29 PM   #10
frushiyama
Member
 
Registered: Oct 2010
Location: Brazil, SP - Cosmópolis
Distribution: Slackware
Posts: 165

Original Poster
Rep: Reputation: 28
This change:
Quote:
Originally Posted by bassmadrigal View Post
Try removing some of the restrictions on the conf file to see if that is what's causing the problem. A simple 4 lines per share on mine gives me complete read/write access.

Code:
[familia]
  path = "/samba/familia"
  readonly = No
  create mask = 0777
  directory mask = 0777
You can rename this to familia2 to keep your current configuration in place.
And also mask 0000 make real_ushiyama user lose write acess.

Last edited by frushiyama; 12-15-2014 at 03:31 PM.
 
Old 12-15-2014, 04:16 PM   #11
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 7,390

Rep: Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083Reputation: 5083
These masks are different than the ones in the mount. These are explicit permissions and need the actual unix permission numbers, not the opposites like the mount command. All 0s (0000) would cause the creator to lose access as well as others. If you want just the owner to have full permissions and the group and others to have read only, it would be 0744. If you don't want others to have any access, it would be 0740. Or if you only want your user access and not the group or the others, 0700 would be the right one.

Both the create mask and directory mask are only for created files/directories (as far as I can tell from the docs). The rest of the existing files and directories will follow the permissions in the mount command (if they're explicitly set).
 
1 members found this post helpful.
Old 01-22-2015, 07:12 PM   #12
frushiyama
Member
 
Registered: Oct 2010
Location: Brazil, SP - Cosmópolis
Distribution: Slackware
Posts: 165

Original Poster
Rep: Reputation: 28
It was missing add the user francis on the samba from the server, then put the user in correct group and also correct the permissions on folders.
With the .smbcred on regular user folder i can mount and write with:
Code:
mount -t cifs //192.168.1.106/familia /home/francis/familia/ -o "rw,uid=francis,forceuid,dir_mode=0022,file_mode=0022,credentials=/home/francis/.smbcred"
Marking this as solved!
 
  


Reply

Tags
cifs, samba


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
manual mount cifs works but srcipt mount cifs has mount error (13): Permission denied CADIT Linux - Newbie 6 11-20-2009 02:48 PM
Help with mounting samba share: smbmount or mount.cifs error: permission denied wdli Linux - Server 1 08-11-2009 11:31 PM
mount.cifs - mount error 20 = Not a directory da_kidd_er Linux - Networking 10 10-16-2008 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration