Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Samba setting

Posted on 1998-09-17
Medium Priority
Last Modified: 2012-06-27
I have a pc running Linux and Samba, then I export HDD to
NT machines. Here is output of ls in NT:

C:\> ls -l U:/home/yan/a.c
-rwxrwxrwa   1 <unavail>       <unavail>            85 Sep 16 19:28 u:/home/yan/a.c

But if I use the same command (ls.exe) for other files in NT machines, the <unavail> field will be filled by owner's name and group.

My question is how to set Samba to let it give same result
as NT.

The background for my question:
I am using NuTCracker (a simulation of UNIX?) in my NT machine, so I have ls.exe, chmod.exe and so on.
I want to use RCS for files in Samba harddisk, but RCS
gives an error when it tries to call chmod() system call.
chmod.exe also give same error message as chmod() if the
file is located on Samba harddisk:
     Error: The request for network is not supported.
But if the file is on NT harddisk (local or remote), chmod.exe
works well as well as RCS.
By invistigate the reason, I found the security attribute
of samba files is different from that of NT files.
So I think if I can change some setting in samba, then I can get same result as from NT harddisk.

Please give me some ideas.

Question by:yan051197
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 1586868
I expect the file has an owner/group for which no name appears in /etc/passwd.


Author Comment

ID: 1586869
Thanks for your quick response.

But that file has valid user/group in /etc/passwd.
Here is output of Linux ls:
home:/home1/public/home/yan# ls -l
total 112
drwxr-xr-x   2 pcuser   users        1024 Sep 17 15:34 RCS/
-rwxr--r--   1 pcuser   users          85 Sep 16 19:28 a.c*
-rwxr--r--   1 pcuser   users        7680 Sep 16 19:40 a.exe*
-rwxr--r--   1 pcuser   users         323 Sep 16 19:39 a.o*
-rwxr--r--   1 pcuser   users        7680 Sep 16 19:39 a.out*

But the username/group do not exist in NT system,
should I add username/group in NT?
Then how to mapping NT's user/group to UNIX?


Expert Comment

ID: 1586870
You're MUCH better off using CVS in that kind of environment.  You can migrate to CVS from RCS while still keeping the RCS files; I highly reccomend it.  It will actually avoid all those problems as well as allowing much faster compiles (since you get a copy of the source on a local disk if you want it).

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.


Author Comment

ID: 1586871
I will find CVS now and to try to use it in my environment.
But we are using NT, so I am afriad no CVS version for NT.


Expert Comment

ID: 1586872
Of COURSE there is a version of CVS for NT.
See http://www.cyclic.com/


Author Comment

ID: 1586873
Thank you very much.
I have downloaded from that site and I will install it now.
That company olny sell CD-ROM to U.S.A. But I am in Japan.


Expert Comment

ID: 1586874
I think your problem is because Samba was meant to sharing Linux with Windows users, but you are using non NT, or Windows commands from what Linux thinks is a Windows share. If you issue the same commands from NT's native system commands it should work, but in order for the Unix type commands to work from the NT box, the programmers would have to know that you were going to use them that way so they could have written them to work that way. If you were on a true Unix platform, it would work because you would not be using samba.  You can Telnet in and use whatever you like, but the interface you are trying to make happen was not meant to be.  
This is only my opinion, and as such, is subject to change in proportion to my level of knowledge at any given momement.

Author Comment

ID: 1586875
Thanks for joe_massimino.
Perhaps my question was not clear.
The problem in fact also occur in native NT environment.
If we use NT Explorer for any file in another NT share,
then we can see the "Security" tab (page) from the properties menu, so you can set the ACL, etc.
But if we use NT Explorer for any file in Samba share,
we can not see the "Security" tab (page) from the properties
Samba is desgined to appear as a NT machine, so I think it should
act same as other NT shares, the key point maybe how to set some
parameters in smb.conf?

Bye the way, I decided to use CVS as recommended by JYOUNGMAN,
and I hope CVS will work happy with Samba.

Thanks again.

LVL 51

Expert Comment

ID: 1586876
beside CVS vs. RCS, back to the initial question, did you try following in  smb.conf

  force user  = %U
  force group = %G

Accepted Solution

alexbik earned 200 total points
ID: 1586877

What you are trying won't work. With samba, a share is mounted as a specific user. Which user this is (and what his/her rights will be) is determined at mount time, not afterwards. That means that all files on that share, seen from the client side, will have the same owner. There's nothing you can do about that. If you want to be able to change owners of files that are on remote filesystems, you will definitively need a different protocol, NFS for instance.


Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question