LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-02-2017, 03:13 AM   #1
dancer_69
LQ Newbie
 
Registered: May 2011
Posts: 16

Rep: Reputation: Disabled
samba shared folder between 2 linux pcs


Hello,
I'm trying to setup samba to get access to a laptop's ntfs partition, from desktop pc. I want to only the user of desktop pc to have access read/write to laptop's partition which is mounted to /meda/data folder which belongs to laptop's user.
I have configured the laptop' s smb.conf like this:
Code:
[laptop-data]
path=/media/data
valid users=desktopuser
public=no
writable=yes
browsable=yes
I always get error when I input the password, that is wrong.
It confuses me the "valid users" option though. Is for the users of remote machine(desktop pc in my case), or the local users? I tried both(desktop and laptop user) but I get the same error. I also tried to set smbpasswd for desktopuser(in desktop pc), but I get the same error.
What am I missing?
 
Old 10-03-2017, 02:54 AM   #2
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
You have to add the user (along with smb password) on the samba server, not the client. The list of samba users and passwords is independent of the normal users and passwords.

On the laptop, use the command:

Code:
smbpasswd -a desktopuser
This will both add the user and let you enter the samba password for dektopuser.

If you run smbpasswd on the desktop, or modify smb.conf (if it even exists) on the desktop, it will have no effect. These settings only affect the server, not the client. Therefore, it will only affect samba shares on the desktop (shared to other computers). It has no effect on how the desktop connects to samba shares on other computers.
 
Old 10-03-2017, 03:23 AM   #3
dancer_69
LQ Newbie
 
Registered: May 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Thanks for explanations.
The problem is that I tried to add the desktopuser in laptop by the command you mentioned but it doesn't work. I get the error:
Code:
failed to add entry for user desktopuser
EDIT:
I found that is needed to also create the desktopuser in laptop by adduser.
I found this info here:
https://ubuntuforums.org/showthread.php?t=1513840
I already configured my folder though using archwiki(without specific user access) and working fine.
Maybe I will try again this way in the future.
Thanks for help anyway.

Last edited by dancer_69; 10-03-2017 at 05:33 AM.
 
Old 10-03-2017, 06:57 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,749

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
What distribution/version are running on your computers? Since both laptop and desktop are running linux there are multiple ways to connect without using samba. sftp would be the easiest since there is basically very little setup required.

In addition if connecting using samba both computers do not need to have the same username account but as stated you need to create a samba user/password on the laptop that matches your laptop real user. The valid user would be your laptop user name and not the desktop username although you already created an account with your desktop username.

Using sftp requires the ssh server to be installed/running on the laptop and opened in the firewall if running. Most file browsers have the capability to connect to another server using multiple methods. Typically you can select connect to server using sftp or specify a url (sftp://laptop_ip/media/data). You will then be prompted for your laptop username / password.
 
Old 10-03-2017, 07:21 AM   #5
dancer_69
LQ Newbie
 
Registered: May 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Ι' m running arch linux in both. I want to have read/write access to the folder(it's an ntfs partition actually). I tried nfs at first but I couldn't get write access, no matter which options I used. Now I've configured samba following arch wiki and I can browse/read/write the folder as guest user(I suppose) which doesn't need password. It' s not a big deal because there aren't any other pcs/users in network, so for now it's ok.
 
  


Reply



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
Linux Samba shared folder not accessed from host Windows jjang1212 Linux - Networking 4 09-17-2015 12:39 PM
[SAMBA] Cannot find my shared folder dragonix Linux - Newbie 8 11-23-2012 12:40 AM
[SOLVED] Samba Entry of fstab to mount windows shared folder on Linux machine vikas027 Linux - Server 6 12-23-2010 01:52 AM
Samba shared folder size CitizenjaQ Linux - Server 1 09-02-2008 04:44 PM
Samba shared folder klmn1 Linux - Server 5 08-20-2008 04:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:18 AM.

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