Basic linux/samba question
-
- Posts: 87
- Joined: Tue Jun 19, 2007 3:26 pm
- Location: Manchester, GA
- Contact:
Basic linux/samba question
Wondering why samba will give me access to the specified folder in smb.cnf but not access to all subfolders from windows.
Abel Aguilar, DMD
http://www.DrAguilar.com
http://www.DrAguilar.com
-
- Posts: 87
- Joined: Tue Jun 19, 2007 3:26 pm
- Location: Manchester, GA
- Contact:
-
- Posts: 87
- Joined: Tue Jun 19, 2007 3:26 pm
- Location: Manchester, GA
- Contact:
the folder is /var/lib/mysql
I want to have access to databases within mysql which are in separate folders.
I want to have access to databases within mysql which are in separate folders.
Abel Aguilar, DMD
http://www.DrAguilar.com
http://www.DrAguilar.com
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
I've had trouble with Linux permission from day one. Every time the MySQL database is upgraded to a new version of OD, it reassigns the owner of certain database files to be 'mysql'. Then I have to change the permissions before I can make backups from my personal computer. My point is that even once you get the permissions set, you can expect to have to set them again later.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
-
- Posts: 87
- Joined: Tue Jun 19, 2007 3:26 pm
- Location: Manchester, GA
- Contact:
can you post the commands you use to give this new database folder the correct permissions?
Abel Aguilar, DMD
http://www.DrAguilar.com
http://www.DrAguilar.com
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Commands? I'm too stupid to type in commands. I just highlight my opendental folder, rightclick, permissions. Then I check the box to apply to all subfolders and click OK. I waste about 20 seconds performing this ritual every day.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
-
- Posts: 87
- Joined: Tue Jun 19, 2007 3:26 pm
- Location: Manchester, GA
- Contact:
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Yes, I'm doing this on Linux. I use SUSE which comes with the KDE graphical interface. Almost as good as MS Windows.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
-
- Posts: 87
- Joined: Tue Jun 19, 2007 3:26 pm
- Location: Manchester, GA
- Contact:
Jordan when I right click on a folder in ubuntu distro I don't have the option to change permissions. Even when I R click , properties, and permissions tab is greyed out.
Abel Aguilar, DMD
http://www.DrAguilar.com
http://www.DrAguilar.com
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Yes, I've seen the graphical interface block me from performing actions which it decided were dangerous. But var/lib/mysql/opendental (or whatever the path is) has never been a problem for me.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
-
- Posts: 87
- Joined: Tue Jun 19, 2007 3:26 pm
- Location: Manchester, GA
- Contact:
no for some reason ubuntu does not allow the system administrator to log in, but there must be a way. i'll have to check google for that one.
Abel Aguilar, DMD
http://www.DrAguilar.com
http://www.DrAguilar.com
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Doesn't allow the administrator to log in? How on earth do you expect to get anything done that way?
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
-
- Posts: 87
- Joined: Tue Jun 19, 2007 3:26 pm
- Location: Manchester, GA
- Contact:
well just found out how to change that. in ubuntu you get a admin password window before admin changes are allowed. Its supposed to be a security measure to prevent use of root and compromise security for computers connected to the WWW.
Abel Aguilar, DMD
http://www.DrAguilar.com
http://www.DrAguilar.com
This document explains you how to mark a file as executable using the Ubuntu user interface:
https://help.ubuntu.com/7.04/user-guide ... ermissions
Ubuntu doesn't allow you to log on as the root user - and for good reasons. You should never log on as the root user. If you log on as the root user, every program you launch has root priviliges. Imagine what can happen when you open a malicious program. (The same goes for Windows).
If you open an application on Ubuntu that requires administrator priviliges, Ubuntu will ask you for the password.
If you really want to execute a series of commands as root, you can always type
at the command line.[/url]
https://help.ubuntu.com/7.04/user-guide ... ermissions
Ubuntu doesn't allow you to log on as the root user - and for good reasons. You should never log on as the root user. If you log on as the root user, every program you launch has root priviliges. Imagine what can happen when you open a malicious program. (The same goes for Windows).
If you open an application on Ubuntu that requires administrator priviliges, Ubuntu will ask you for the password.
If you really want to execute a series of commands as root, you can always type
Code: Select all
sudo su
Frederik Carlier
Not sure if this is still an active topic...but here's a quick guide to help get you started in command line:
Chmod changes the permissions on files, Chown changes the owner. So, if you'd like to change them...
1) What are the permissions? Issue the following command to check them out:
ls is a command to list contents of a directory. -tlrh are some arguments to alter the output. Here's what they stand for:
2) Change the permissions with chmod.
If you use the following code files will be come readable by everyone:
ogu stands for "Other + Group + User"...that's everybody!
+r means to add read access to the following files...
* will give you all files in that directory.
Also, I agree completely with fcarlier. Logging in to Linux as root (or any other system with the equivalent, for that matter) can be a very bad idea. In Ubuntu the Windowing system (Gnome, KDE, etc...) will alert you when root permissions are required.
Chmod changes the permissions on files, Chown changes the owner. So, if you'd like to change them...
1) What are the permissions? Issue the following command to check them out:
Code: Select all
ls -tlrh
Code: Select all
t - sort by modification time
l - use a long listing formation (shows the permissions)
r - reverse the order, so the most recent things are listed on the bottom. This is helpful if you have lots of files in a directory and are looking for the newest
h - Make the sizes human readable (show in KB, MB, or GB)
If you use the following code files will be come readable by everyone:
Code: Select all
chmod ogu+r *
+r means to add read access to the following files...
* will give you all files in that directory.
Also, I agree completely with fcarlier. Logging in to Linux as root (or any other system with the equivalent, for that matter) can be a very bad idea. In Ubuntu the Windowing system (Gnome, KDE, etc...) will alert you when root permissions are required.
plusjordansparks wrote:I've had trouble with Linux permission from day one. Every time the MySQL database is upgraded to a new version of OD, it reassigns the owner of certain database files to be 'mysql'. Then I have to change the permissions before I can make backups from my personal computer. My point is that even once you get the permissions set, you can expect to have to set them again later.
plusYes, I'm doing this on Linux. I use SUSE which comes with the KDE graphical interface. Almost as good as MS Windows.
Hi Jordan,Commands? I'm too stupid to type in commands. I just highlight my opendental folder, rightclick, permissions. Then I check the box to apply to all subfolders and click OK. I waste about 20 seconds performing this ritual every day.
From what you write above it seems you are using the KDE graphical interface to change the permissions on folder opendental. This is actually running the command chmod -R something.
This could be automated, so that you merely had to click on an icon on your KDE desktop. Here's how a database named "opendental" could be automatically backed up to a USB stick by clicking on a desktop icon that you create.
1. As root
Code: Select all
chown jordan /usr/share/templates/.source/Program.desktop
3. On the various selection boxes change the permissions to executable, the command to
Code: Select all
sudo /usr/local/bin/saveToUSB
4. Create a text file in folder /usr/local/bin called saveToUSB with the following contents
Code: Select all
#!/bin/bash
mysqldump -n -t -u root opendental > /mnt/usbstore/opendental.sql
5. You should now have a desktop icon that you can click to execute the command to write a mysqldump to file opendental.sql on your usbstick.
There are plenty of other commands that can be automated on a KDE desktop in this way.
The directories might be slightly different for SUSE (I'm using Sidux which is Debian Sid based), but hopefully this will give you the general idea.
http://www.knoppix.net/forum/viewtopic.php?t=17570
is a link to a discussion where other scripts are outlined for automating the saving and restoring of mysql data under Linux.
Below are some snapshots that might help.
Regards,
Mark Preston





- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
Re: Basic linux/samba question
Weird. I Havent tried this.... I dont think. This could most likely be achieved in the samba user file or maybe done with chmod 777 * which might be more then you want.... Or what if you added the user to the mysql group?
But what if the samba user file just mapped like
samba user=joe unix user accounts=joe, mysql
example of the smbusers
http://users.tkk.fi/~jwagner/pdfServer/smbusers
I wonder if this would work..... maybe not.
# Unix_name = SMB_name1 SMB_name2 ...
root = administrator admin
nobody = guest pcguest smbguest
mysql = smbuser
user = smbuser
Hmmm kind of doubt it. But it might.... Dont know who would be the owner if a file was saved though... maybe mysql because it was specified first...
Doubt it.
But what if the samba user file just mapped like
samba user=joe unix user accounts=joe, mysql
example of the smbusers
http://users.tkk.fi/~jwagner/pdfServer/smbusers
I wonder if this would work..... maybe not.
# Unix_name = SMB_name1 SMB_name2 ...
root = administrator admin
nobody = guest pcguest smbguest
mysql = smbuser
user = smbuser
Hmmm kind of doubt it. But it might.... Dont know who would be the owner if a file was saved though... maybe mysql because it was specified first...

Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Re: Basic linux/samba question
I think that if you create a script that changes the permissions and you put it in the automated startup tasks (example: chmod the permissions to 777 on folder X) it will be more easier than cliking it every day.This could be automated, so that you merely had to click on an icon on your KDE desktop.
Re: Basic linux/samba question
I think it's a lot easier to allow the "mysql" user on the Linux server to maintain ownership of the files, and not play around with trying to change permissions. That's partly what makes it more secure than a Windows network share. Then use "mysqldump" utility to get a backup; for example:
mysqldump -v -h linuxhost -u root opendental > d:\backups\odbackup.sql
xcopy s:\OpenDentImages d:\backups\OpenDentImages /i/e/d/k/r
Using those commands in a batch file, a Windows machine could copy the database and image folders to its D: drive. The S: drive would be the Linux Samba share. Better still, if the Windows machine is a backup MySQL server, it can pass the running database to "localhost" with this:
mysqldump -v -h linuxhost -u root opendental | mysql -u root -C opendental
The -v switch for "verbose" just lets you see what it's doing.
mysqldump -v -h linuxhost -u root opendental > d:\backups\odbackup.sql
xcopy s:\OpenDentImages d:\backups\OpenDentImages /i/e/d/k/r
Using those commands in a batch file, a Windows machine could copy the database and image folders to its D: drive. The S: drive would be the Linux Samba share. Better still, if the Windows machine is a backup MySQL server, it can pass the running database to "localhost" with this:
mysqldump -v -h linuxhost -u root opendental | mysql -u root -C opendental
The -v switch for "verbose" just lets you see what it's doing.
DMA, Inc.
http://www.dmatechsolutions.com
http://www.dmatechsolutions.com