You are not logged in.
Hi,
I've got a home LAN consisting of a box, a laptop, and a hardware router. A box I've configured as a samba server as best I could: just followed the Wiki, default configuration; now I have a bit of a trouble appreciating my handiwork on the client (laptop) side.
Server side info($ testparm):
$ testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
workgroup = MYGROUP
server string = Samba Server
log file = /var/log/samba/%m.log
max log size = 50
printcap name = /etc/printcap
dns proxy = No
idmap config * : backend = tdb
[homes]
comment = Home Directories
read only = No
browseable = No
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
print ok = Yes
browseable = No
$ Client side ($ smbclient -L stovepipebox -U%):
$ smbclient -L stovepipebox -U%
Domain=[MYGROUP] OS=[Unix] Server=[Samba 4.1.16]
Sharename Type Comment
--------- ---- -------
IPC$ IPC IPC Service (Samba Server)
Domain=[MYGROUP] OS=[Unix] Server=[Samba 4.1.16]
Server Comment
--------- -------
Workgroup Master
--------- -------
$Meanwhile, Wiki suggests mounting my share this way:
# mount -t cifs //SERVER/sharename /mnt/mountpoint -o user=username,password=password,workgroup=workgroup,ip=serveripI have trouble placing SERVER and sharename for starters. Does it look like server configuration is somewhat deficient? Sorry, this is my first experience with samba
.
There's samba_user on server, too:
$ smbclient -L stovepipebox -U samba_user
Enter samba_user's password:
Domain=[MYGROUP] OS=[Unix] Server=[Samba 4.1.16]
Sharename Type Comment
--------- ---- -------
IPC$ IPC IPC Service (Samba Server)
samba_user Disk Home Directories
Domain=[MYGROUP] OS=[Unix] Server=[Samba 4.1.16]
Server Comment
--------- -------
Workgroup Master
--------- -------
$ Is it enough to suggest the mount command parameters?
Last edited by Llama (2015-02-16 13:28:13)
Offline
Discovered Samba Tips and Tricks and streamlined a bit my frustration. Current state of affairs:
1. /etc/hosts:
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
192.168.1.33 alfabox.localdomain alfabox
192.168.1.34 bravobox.localdomain bravobox
# End of file2. /etc/samba/smb.conf:
[global]
workgroup = WORKGROUP
server string = Samba Server
netbios name = SERVER
name resolve order = bcast host
dns proxy = no
log file = /var/log/samba/%m.log
create mask = 0664
directory mask = 0775
force create mode = 0664
force directory mode = 0775
; One may be interested in the following setting:
;force group = +nas
[media1]
path = /home/alexey
read only = No3. Got a samba user on the server box: samba_user. I have no idea how to utilize it, though.
4. Discovered that the mounting problem looks exactly the same on the server box, so experimenting is limited so far to the server box.
alexey@alfabox ~ $ smbclient -L alfabox -U%
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.16]
Sharename Type Comment
--------- ---- -------
media1 Disk
IPC$ IPC IPC Service (Samba Server)
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.16]
Server Comment
--------- -------
SERVER Samba Server
Workgroup Master
--------- -------
WORKGROUP SERVER5. An attempt at mounting:
alexey@alfabox ~ $ sudo mount -t cifs //alfabox/media1 /mnt/ss
Password for root@//alfabox/media1:
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
alexey@alfabox ~ $ sudo mount -t cifs //192.168.1.33/media1 /mnt/ss
Password for root@//192.168.1.33/media1:
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
alexey@alfabox ~ $ No password I can think of is good enough. What am I missing? Yes, I want to share r/w my entire home directory, passworded.
Last edited by Llama (2015-02-15 08:09:52)
Offline
The samba user you are using has to have read access to the folder you are sharing on your server box. If you share /home/usera and try to access it with samba_user, you won't be able to access it - because your home folder is usually set to be only accessible by your user account only.
edit:
You should be using the wiki way of mounting it, by specifying user and password, not the root password. I suggest you read through the samba wiki article again, creating samba users and how to use them is described there.
What I do is create a samba user for every user account on the server (same name) that needs access to shares. That way my smb users have the same access rights as the local ones. All of them are part of the sambashare group, so if I want to share a folder the user usually doesn't have access to, I just set the group of that folder to sambashare and create the share on the server. All of this is described in the wiki article.
Last edited by Soukyuu (2015-02-15 18:06:43)
[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]
Offline
Thanks, SouKyuu!
Yes, my server Linux account need not be anything special
. I didn't get it.
Step by step instruction, like (lest I shoud forget it all):
Purpose: make a single r/w share of an entire user directory (alexey)
available via samba password
SERVER:
Create Samba user account:
$ sudo pdbedit -a -u alexey ;; note that alexey is an existing Linux user
Delete Samba user account (e.g. created by mistake):
$ sudo pdbedit -x samba_user
$ sudo userdel samba_user ;; if not needed - no suicide!
/etc/samba/smb.conf:
[global]
workgroup = WORKGROUP
server string = Samba Server
netbios name = SERVER
name resolve order = bcast host
dns proxy = no
log file = /var/log/samba/%m.log
create mask = 0664
directory mask = 0775
force create mode = 0664
force directory mode = 0775
; One may be interested in the following setting:
;force group = +nas
[alexey]
path = /home/alexey
read only = No
Starting:
$ sudo systemctl start smbd nmbd
CLIENT:
Check (alfabox is the server host name; IP address will do, too):
$ smbclient -L alfabox -U%
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.16]
Sharename Type Comment
--------- ---- -------
alexey Disk
IPC$ IPC IPC Service (Samba Server)
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.16]
Server Comment
--------- -------
SERVER Samba Server
Workgroup Master
--------- -------
WORKGROUP
Manual mount (pwd from $ sudo pdbedit -a -u alexey ;; server side):
$ sudo mount -t cifs //SERVER/alexey /mnt/stove -o user=alexey,password=pwd,workgroup=WORKGROUP,ip=192.168.1.33
Routine mount:
.smbcredentials (plain text, basic security):
username=alexey
password=pwd
$ sudo chown root:root /home/alexey/.smbcredentials
$ sudo chmod 660 /home/alexey/.smbcredentials
/etc/fstab:
//192.168.1.33/alexey /mnt/stove cifs credentials=/home/alexey/.smbcredentials,comment=systemd.automount,uid=alexey 0 0Offline