Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm running Windows 2k as a domain controller and have samba setup on RH9 as a file server.
I would like to have samba store and serve my roaming profiles. While this sounded like a good idea at the time I am having no luck at all making this work.
Trying this with a test account I've created a test user account with the same user id/password on all services, for example:
Samba user:
jblack/P@$$w0rd
Linux user:
jblack/P@$$w0rd
Windows user:
jblack/P@$$w0rd
When this user tries to log in I get a message saying that a server copy of the profile exsists that does not have the correct security and that the folder must be owned by the user or admin (I get this no matter who owns the folder... root, jblack, etc).
Thanks for the reply.
I believe I did by using chmod -R 777 <folder name containing profiles>
Usually not the best practice to leave a folder wide open like that but my users (i.e.: family members) usually have to be shown a share actally exsists as well as be told what can be done with it.
What's with all of the user shares. If you want to share home directories, use the built in [homes] share as opposed to having individual shares.
Code:
# Slightly modified version
[homes]
comment = Home Directory for %U
browseable = no
writeable = yes
valid users = %S
create mode = 0660
directory mode = 0770
As for the profile stuff, how do you go about setting it up. I can't remember at the top of my head and I just blew away my 2k server. I blew it up to play with email. You will need to open up "active directory users and computer" and set up the appropriate values for the profile path. Do you have something like \\<Samba_Server_Name>\%Username%? I just noticed that you didn't explicitly name your samba server. It is a good idea to put the value for netbios name in there.
What is the value you have set it Active Directory for each user.
I have it set up so that the Profile share on the server points to a subfolder of the user's home directory as opposed to creating a 2nd directory structure for profiles. The problem is that the NT-Profile folder is not always there so I tried using the preexec option to create the folder. I want to set up a script to check whether the folder already exists. The script's name is create-profile and the username should be passed as a parameter so the preexec for the profile share will look like:
preexec = /etc/samba/scripts/create-profile %u
The script is a plain old bash script, or at least it was. I deleted the meat of the script that was supposed to do the file checking. Anyway the script now looks like
#!/bin/bash
HomeDirectory=`echo ~$1`
echo $HomeDirectory
At an earlier stage it created the directory but something didn't go right. If I logged in, it created a folder called "~sid" in the /etc/samba/scripts directory. The only way I got it to work was by slightly modifying the script and sending it the %H macro (The user's home directory.)
To make a long story short, is there a way to expand ~sid in a bash script or do I have to send the script the %H?
Shouldn't the above result in /home/sid displayed to the screen?
Last edited by sidmark-2850; 10-02-2003 at 12:36 AM.
I beleive sidmark-2850 has answered your questions above. Just use the "homes" share and create a profiles share too.
sidmark-2850 - since the script isn't being run as the user there will probably be no home dirs to expand to. Just pass the variable as an argument as you suggested.
david_ross, even if I ran the script manually, I get a directory called "~sid". I guess, I will just have to pass the %H in. I thought that there was a way to expand it to /home/sid.
Hey, where is a good resource to learn perl. I am going to buy the "Learning Perl" book by O'reilly. What are good online resources?
Oh, I was going to use the root preexec and then chmod and chown it to the user.
Last edited by sidmark-2850; 10-02-2003 at 03:00 PM.
Being a newbie I guess having a share for each user is the natural thing one would do. I'm glad you pointed out an easier way to do it... that's great.
Explicitly naming the Samba server netbois name is something else I overlooked (affectionately known as "Marge")
I'll give all these things a try over the week-end.
User profile path for n7kn in Active Directory look like this:
\\Marge\n7kn
That didn't work. I created a folder called "shared" and a subdirectory for each user in it. In an attempt to remove all obstacles that Samba could offer I ran 'chmod -R 777 shared'
Active Directory user profile path for n7kn looked like this:
\\Marge\shared\n7kn
I'm not sure about using the % symbol on each side of the target directory. Maybe someone can explain that.
One final question would be regarding "blowing away" one's Win2k server. What caliber would you recommend (bullet weight in grains) and how far down-range should the server be placed.
This is a piece of advice would most probably simplify matters greatly.
n7kn, you can find what the % characters mean if you do man smb.conf.
From man smb.conf
Code:
VARIABLE SUBSTITUTIONS
Many of the strings that are settable in the config file can take sub-
stitutions. For example the option "path = /tmp/%u" would be inter-
preted as "path = /tmp/john" if the user connected with the username
john.
These substitutions are mostly noted in the descriptions below, but
there are some general substitutions which apply whenever they might be
relevant. These are:
%S the name of the current service, if any.
%P the root directory of the current service, if any.
%u user name of the current service, if any.
%g primary group name of %u.
%U session user name (the user name that the client wanted, not
necessarily the same as the one they got).
%G primary group name of %U.
%H the home directory of the user given by %u.
%H the home directory of the user given by %u.
%v the Samba version.
%h the Internet hostname that Samba is running on.
%m the NetBIOS name of the client machine (very useful).
%L the NetBIOS name of the server. This allows you to change your
config based on what the client calls you. Your server can have
a "dual personality".
Note that this paramater is not available when Samba listens on
port 445, as clients no longer send this information
%M the Internet name of the client machine.
%N the name of your NIS home directory server. This is obtained
from your NIS auto.map entry. If you have not compiled Samba
with the --with-automount option then this value will be the
same as %L.
%p the path of the service's home directory, obtained from your NIS
auto.map entry. The NIS auto.map entry is split up as "%N:%p".
%R the selected protocol level after protocol negotiation. It can
be one of CORE, COREPLUS, LANMAN1, LANMAN2 or NT1.
%d The process id of the current server process.
%a the architecture of the remote machine. Only some are recog-
nized, and those may not be 100% reliable. It currently recog-
nizes Samba, WfWg, Win95, WinNT and Win2k. Anything else will be
known as "UNKNOWN". If it gets it wrong then sending a level 3
log to samba@samba.org
<URL:mailto:samba@samba.org> should allow it to be fixed.
%I The IP address of the client machine.
%T the current date and time.
%$(envvar)
The value of the environment variable envar.
There are some quite creative things that can be done with these sub-
stitutions and other smb.conf options.
These substitutions really come in handy and can be used in different situations and even troubleshooting.
You have a couple of options in regards to profile storage. Your easiest one is to create and use the homes share like mentioned, and set your active directory user profile path to: \\Marge\Homes\Profile. This should be your best bet since \\Marge\Homes\Profile will be unique to each user as it points to the Profile directory within the client's home folder.
I ended up creating a profile share which directly pointed to a subfolder of the clients's home directory, so I can just set the AD path to \\Madison\Profile and it would auto create the folder and use it for storage. I had the script working, but unfortunately, it's gone. The reason that it is gone is that it was on my test box, which was at a point earlier on last week my 2k server. Stupid me, I forgot to copy the script.
Now, on to the blowing up your win2k machine, or any machine in fact. There are a number of options you can use to do the job. For my linux boxes, I use Kickstart Installations because I fool around and test too much and I hate selecting packages and options manually, especially for the number of times I do it in a week, or even a day (if I really mess up someting.) It has an option to wipe out your entire partition tables and create new ones. For win2k or windows for that matter, I normally use a 3 1/2" floppy armed with format and fdisk. Another personal favorite of mine is Ranish Partition Manager. Another one that does the job in 1/4 of the time is the tool gdisk which comes with norton ghost. Use it in the right or wrong way (if you really didn't intend to do it) you can wipe your entire disk squeaky clean.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.