LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   NTFS Permissions (https://www.linuxquestions.org/questions/linux-networking-3/ntfs-permissions-239251/)

DirtyDan 10-05-2004 10:40 PM

NTFS Permissions
 
In Samba, without having the right permisions to a shared folder, I will get the NT_STATUS_BAD_NETWORK_NAME error; Easily fixed with chmod 777 (or +r or something similar) to the folder. But, I would like to share a folder on my NTFS drive. There is no way to set permissions for this folder, and without doing so, I am stuck without access. chmod -R 777 /(folder name) would work great, but as stated i can not modify permissions. Is there a way to work samba around this?

Im sorry, I realize this is somewhat of a double-post, but my old thread was extremely ambigous and badly worded, not to mention written at a point where samba was not even running :rolleyes:

Thanks!

NetSnake 10-05-2004 11:01 PM

Are you sure your kernel support NTFS write config?
I assumed you must have this value to do your work.

DirtyDan 10-05-2004 11:05 PM

No, I don't have write support on my kernel, but I wont be using this either. All I want to do is play MP3 files on this linux box on my downstairs XP machine that has ~1gb hd space, these files being on the NTFS partition of the linux box. They only need read-only access, but samba wont give me permission to even view them! Ugh.... Im so lost

Are you saying that for samba to let me in I have to recompile my kernel with NTFS write support? Hmmm wheres that config file.. I think I still have the kernel saved.....

NetSnake 10-05-2004 11:30 PM

If that, you can try
mount -t smbfs -o umask=777 // I'm not very sure, may be 000
to mount your share?

DirtyDan 10-05-2004 11:49 PM

so it would be mount -t smbfs -o umask=777 //localhost/ntfs-c/ /home/

Or something? I cant get anything to work, and my shares are all screwed up now, and Lisa stopped working (giving the erno : 98 port in use error) and.... To format and start clean or not to format....

Lisa is still screwy but I restarted samba and stuff and now it's OK again. I just shared everything for testing purposes (didnt chmod it all :p ) and now doing smb://192.168.1.100/root/ I can view every file and folder pretty much, EXCEPT for the /ntfs-c/ folder! It asks for a username and password: surely this is not my windows logon, is it? I know that the ntfs filesystem is supposed to be secure like that (or something)

nordickiwi 10-06-2004 07:38 AM

to start with stating the obvious,
-that you have installed some sort of NTFS support in your kernel, i use Fedora so it's an easy rpm for me. http://linux-ntfs.sourceforge.net/rpm/about.html

-you have mounted the ntfs partition so it mounts at every boot, to the folder /ntfs-c for exemple.
- write permissions for ntfs from linux is a myth, unless you regard that you can actually write to ntfs as long as you don't change the file size!!!! duh.
- you have created a samba share that looks somewhat like this
[ntfs-c]
comment = mp3
path = /ntfs-c/mp3
writeable = no
browsable = yes
public = yes

- you must have done this.
useradd john
passwd john
*set a password x 2 *


cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd
*do this only once, preferably after you have created all the samba users you need*

smbpasswd john
*enter the same password x2 as you will use to log into the windows machine*

service smb restart

Login to the windows machine as john. and you should be able to access the mp3 share, without any login screens.
*if the mp3 file are mounted to a folder that is in another users /home/user folder oth than /home/john you may have access problems. So usually mount stuff like this /mp3 /film so alla samba usera can access them. Sharing users home directories to other user's is a hassel.
*If you still can't read/access the share check the file permisions and do a chmod -R 755 /ntfs-c as root.
Hope this helps.

DirtyDan 10-06-2004 06:42 PM

Ok, maybe im just pathetic, but im still having problems. I chmod-ed all the files to 755. Then I did:
useradd basement$ (name of machine)
passwd thepassword
smbpasswd -a -m basement$
(Type new SMB password:) etc.........

Ok, so when I try to open the folder (which now shows up, hurray!) on my XP machine, It says it can not be found or is inaccesible. Maybe my current SMB conf-file will shed some light. (i think something with my path is screwy, although it works in konsole and testparm says its OK...)

Code:

[global]
workgroup = MSHOME
wins support = yes
encrypt passwords = yes
browsable = yes
security = share

[Mp3]
comment = mp3
path = /ntfs-c/Documents\ and\ Settings/All\ Users/Documents/Music/
writeable = no
browseable = yes
public = yes

I also tried logging the error, and it is : /ntfs-c/Documents\and\ Settings/All\ Users/Documents/Music/'
does not exist or is not a directory, when connecting to [Mp3]

Getting around this for now, I did get using simply "/ntfs-c" as the path. I can logon internally atleast with that path, but my XP machine is still struggling. How exaclty do I log on? I added the user as that machine (basement$), but isnt there more to it? Or am I going about that all wrong? I mean, even internally as root I have to provide a password, I dont understand what to do through the other comp. Hell, even if I went 0 security with no users and just the nobody account functioning freely I would be happy

The XP machine is named basement, with 1 user Administrator and password admin.

DirtyDan 10-06-2004 10:04 PM

The XP machine can see the samba share fine, and it shows the directories, but the windows machine is still not logging in correctly. I just setup the 'client for windows networks' client, but to no avail. Is there a specific logon script I need to create for the machine? Does the capital in 'Administrator' yield any adverse effects? Thanks

nordickiwi 10-07-2004 03:13 AM

ok, well done so far your nearly there,
two things come to mind.
-You MUST log onto the XP machine with the same account that you created earlier!! in your case the user basement$. Of course you must firstly create this user on your XP machine with the same Password you used when you did a smbpasswd, becuase when you click on a samba share from windows the samba server checks first the windows account & password that you are currently log in with, if it is the same as a varified samba user then you will be granted access, otherwise you will recieve a login in screen (hope that made sense).

-You share, it seems it would be easier to mount the whole windows partition and share the whole thing as well...then you don't have to worry a linux/samba having to figure out stupid "spaces" i file names. Try adding this to the bottom of your /etc/fstab file, (adjust the hda1 if you have windows on another partition)

/dev/hda1 /ntfs-c ntfs defaults,umask=0022,user 0 0

then adjust your samba share to this,

[Mp3]
comment = mp3
path = /ntfs-c
writeable = no
browseable = yes
public = yes

- set wins support to No, as I'm sure your not using a wins server at home.........not many companies use a wins server.
wins support = No

-Reboot you samba Machine, (to remount the /ntfs-c partition correctly) start the samba server again if not allready set to start at boot.
-Logon to your XP machine with basement$ user, hopefully the $ sign hasn't caused any issues (otherwise go throug the whole useradd stuff again with user administrator.)
access you Mp3 share and browse your way to you music and enjoy, maybe create a simple link to the music folder for easy access.

DirtyDan 10-14-2004 08:53 PM

I have long fixed the login problems now :D :D :D :D

BUT: NTFS mounted directory absolutely refuses to let me share it; it is a read only drive, and its read-write access cannot be altered nor made available to anyone but the owner, from what I can tell. Is there any possible way to get this to work?!?!?!? PLEASE! I am so close, I can read and write to all the other folders, do anything I want, but I cannot share the NTFS file-system folder.

If its unclear what I mean, I have the partition mounted to /ntfs-c, and, upon trying to access it from the other computer, the log file reads "(chdir /ntfs-c) failed" , because I do not have nor can set/change permissions. This is horribly redundant, but I have everything set as it needs to be, and am running on version 3.0.5.

:cry:

DirtyDan 10-15-2004 05:08 PM

Might I be able to change some properties of the mounted drive by the script mounting it on boot, so that I am able to share it? Or should I just scrap the idea and make a FAT32 partition to do my dirty work.

SirAeryn 09-11-2005 09:03 PM

Sharing your NTFS partition can be done - it's just a pain in the a#$%.
The problem is with SELinux and the mount security context.

See my thread http://www.linuxquestions.org/questi...hreadid=361699


All times are GMT -5. The time now is 04:55 PM.