Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to setup a samba share from gentoo box to gentoo box
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1305
Location: sweden

PostPosted: Thu Apr 30, 2020 7:22 am    Post subject: how to setup a samba share from gentoo box to gentoo box Reply with quote

hi

i have hard time to get my gentoo server to share a folder to my network and need some help.here is my setup :

smb.conf

Code:

[global]

# Configure correct UTP
  unix charset = UTF-8
# Change this to the workgroup/NT-domain name your Samba server will be part of
   workgroup = WORKGROUP
 #  security = user
 #  share modes = yes
 server role = standalone server
 map to guest = bad user
 usershare allow guests = yes
 #hosts allow = 127.0.0.1 192.168.0.0/16 192.168.1.29
 #hosts deny = 0.0.0.0/0
#protocol = SMB2.1

#  interfaces = 127.0.0.0/8 eth0
 #  bind interfaces only = yes

# Set share configuration at the end
[Docs]
   path = /media
   writable = yes
   guest ok = yes
   guest only = yes
   force create mode = 0777
   force user = nobody
   directory mode = 0777

[hedmo]
    path = /media/backup
    available = yes
    read only = no
    writeable = yes
    force create mode = 0660
    force directory mode = 2770
    force user = nobody
#   valid users = @hedmo


and i am trying to access it via :

Code:

sudo mount -t cifs '\\192.168.1.25\media' /media/megabox -o sec=ntlm,vers=3.0 --verbose


(this command is just an example what i have tried and i have tried many commands.....)

but i am getting :

dmesg:

Code:

[74553.467665] CIFS: Attempting to mount \\192.168.1.25\media
[74553.641825] CIFS VFS: Unable to select appropriate authentication method!
[74553.641827] CIFS VFS: \\192.168.1.25 Send error in SessSetup = -22
[74553.641838] CIFS VFS: cifs_mount failed w/return code = -2


regards hedmo
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8708
Location: ~Brussels - Belgique

PostPosted: Thu Apr 30, 2020 7:38 am    Post subject: Reply with quote

you need to add a credential file, and the credentials option

/etc/samba/mount.credentials:
username=username
password=password


/etc/fstab:
[...] credentials=/etc/samba/mount.credentials[...]

_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1305
Location: sweden

PostPosted: Thu Apr 30, 2020 7:59 am    Post subject: Reply with quote

xaviermiller wrote:
you need to add a credential file, and the credentials option

/etc/samba/mount.credentials:
username=username
password=password


/etc/fstab:
[...] credentials=/etc/samba/mount.credentials[...]


xaviermiller

thanks for the reply.well i created an new credential for this mount and using this command:

Code:

sudo mount -t cifs '\\192.168.1.25\media' /media/megabox -o vers=2.1,uid=1000,gid=100,credentials=/home/hedmo/.cifs2


now i am getting.

dmesg:

Code:

[77361.422031] CIFS: Attempting to mount \\192.168.1.25\media
[77361.440149] Status code returned 0xc000006d STATUS_LOGON_FAILURE
[77361.440164] CIFS VFS: \\192.168.1.25 Send error in SessSetup = -13
[77361.440184] CIFS VFS: cifs_mount failed w/return code = -13


EDIT:and after adding hedmo :

Code:

smbpasswd -a hedmo
New SMB password:
Retype new SMB password:


i am getting

dmesg:

Code:

[78166.688963] CIFS: Attempting to mount //192.168.1.25/media
[78166.720204] CIFS VFS:  BAD_NETWORK_NAME: \\192.168.1.25\media
[78166.727953] CIFS VFS: cifs_mount failed w/return code = -2
Back to top
View user's profile Send private message
ellaavery
n00b
n00b


Joined: 29 Apr 2020
Posts: 2
Location: uk

PostPosted: Mon May 04, 2020 5:33 am    Post subject: ella Reply with quote

Hello!
it's very simple you can delete and install new file for installations.
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8708
Location: ~Brussels - Belgique

PostPosted: Mon May 04, 2020 8:55 am    Post subject: Reply with quote

replace the backslashes by slashes
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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