LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-20-2006, 05:58 AM   #1
Charlie Spencer
Member
 
Registered: Nov 2003
Location: South Carolina, USA
Distribution: Fedora Core 5
Posts: 106

Rep: Reputation: 15
Newb locked out of /home/username?


When I log on to my Red Hat 9 box I get:

"Please contact your system administrator to resolve the following problem:
Could not open or create the file "/home/username/.gconf-test-locking-file"; this indicates that there may be a problem with your configuration, as many programs will need to create files in your home directory. The error was "Permission denied" (emo = 13)"

Apparently I've locked myself out of my home directory. The last command I entered UNsuccessfully was

"smbmount //server/share /home/username"

I got the error

"smbmnt must be installed suid root for direct user mounts (500,500)"

I follow instructions at http://tinyurl.com/naseq and ran

chmod u+s /usr/bin/smbmnt /usr/bin/smbumount

as su. I was then able to run the smbmount command. These were the only commands I entered since my previous login. My next objective was to read the /etc/fstab file, but when I tried to view it in the GUI, I got an error "Unable to start Text Viewer". I rebooted and got the "Permission denied" error above.

Anybody know what I did wrong this time? I could log on as root and delete the user account, but that won't help me learn what I did wrong.

Last edited by Charlie Spencer; 07-20-2006 at 06:00 AM.
 
Old 07-20-2006, 06:20 AM   #2
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
You mounted the samba share on top of your user directory, so you can't access any of the files that are normally in the directory. The first thing you want to do is unmount the samba share. Without knowing what you're mounting it for, I couldn't say what you should do next, but I'm guessing you should create a directory to mount the share in such as /home/username/share and mount it there. If it's a mount you will want to be using every time you start up the computer, you should add an entry to your /etc/fstab. For security reasons you should disable non-suid access to smbmount, unless you really need it.
 
Old 07-20-2006, 06:38 AM   #3
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
restart your pc and the problem would be gone. if still the problem then log in as root and chown your home dir (/home/user) back to the user (chown -R user: /home/user) this should solve the problem (you donot need to delete and recreate the user). like said before, you mounted your samba share on top of your home dir (/home/user), since you used root to most probably do this, you as a normal user do not have any permissions over it (maybe read, but certainly not write) and any user login certainly would want write permission over the user's home directory and since its not there, the login's are failing.
 
Old 07-20-2006, 07:42 AM   #4
Charlie Spencer
Member
 
Registered: Nov 2003
Location: South Carolina, USA
Distribution: Fedora Core 5
Posts: 106

Original Poster
Rep: Reputation: 15
Gethyn and prozac, thanks.

Gethyn, the share is my home directory on our Windows domain. I do want to mount it every time, and I was trying to read the /etc/fstab file when I first began having problems. Will I be able to use this subdirectory for more than one share, or for other files?

prozac, a complete shutdown did fix the problem, instead of the reboot I previously tried. I did not use root to mount the share, although I did use it for the chmod command. I issued the smbmount as my user account after exiting su. I understand what you're saying about my not having access to the share -IF- I had mounted it as root. Even if I had, why would I be unable to access my entire home directory just because it had a subordinate mount point I couldn't access?

If I understand what you're both saying, I can't mount this share under my Linux home directory without locking myself out. Does that apply only to shares from a Windows domain, or would I have the same problem with any share mounted in /home/username, regardless of the source?

Last edited by Charlie Spencer; 07-20-2006 at 08:13 AM.
 
Old 07-20-2006, 10:29 AM   #5
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
Mounting anything in a directory hides the original contents of that directory. It couldn't work any other way, otherwise what would happen if you had two files with the same name, one inside the directory and one inside the share?

Since you are mounting the share every time you boot, you should most definitely not be mounting it as an ordinary user. There is no need to do so. Just add an entry to /etc/fstab and it will automatically be mounted for you. I have a similar samba share at work. I have created an empty folder in my home directory, and set /etc/fstab to mount the share on that directory. This seems like the most sensible solution to me, if all you are mounting the share for is access to work files stored in it.

If you really, really want to use this share as your home directory, it should be possible. Just mount it to a temporary location, and copy all of the files in your home directory into it. Then set /etc/fstab to mount it for you, and reboot. Make very sure you have set the options for the mount correctly before you reboot though!

Edit: sorry, I missed one of your questions on the first read through. Yes, you can mount any number of different things on the same directory, but only one of them can be mounted at any given time. This means that you cannot mount several shares to the same directory via fstab, as you would need to unmount a share before you could mount the next. If you have several shares you want access to simultaneously, you will have to create mountpoints for all of them.

Last edited by Gethyn; 07-20-2006 at 10:32 AM.
 
Old 07-20-2006, 10:45 AM   #6
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
or mount it under an empty directory inside your home directory.that would work.
 
Old 07-20-2006, 11:48 AM   #7
Charlie Spencer
Member
 
Registered: Nov 2003
Location: South Carolina, USA
Distribution: Fedora Core 5
Posts: 106

Original Poster
Rep: Reputation: 15
Again, thanks.

I'm learning Linux with an emphasis on running it as a desktop client in a corporate Windows Active Directory domain. I installed RH9 on a P600 two weeks ago and I'm climbing the learning curve. I don't have any files in my local home directory to move, and the share is already my home directory for my existing Windows domain account.

"Mounting anything in a directory hides the original contents of that directory. It couldn't work any other way, ... "

It could if you misunderstood how mounting works. I mistakenly thought of it as being like a Windows shortcut. Windows will allow a logical pointer to a directory to exist as a file within another directory. I didn't realize the mounted share actually established the share as the contents of what I mistakely thought was a parent.

I suspect I'll have to do several reinstalls during my education, so I'm going to leave the security on the smbmount command as it is but not change it after the next install. I'll change the /etc/fstab just before I reinstall; that way if I screw it up, it won't matter.

Last edited by Charlie Spencer; 07-20-2006 at 11:56 AM.
 
Old 07-21-2006, 12:18 AM   #8
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
hey charlie,
Quote:
Originally Posted by Charlie Spencer
I don't have any files in my local home directory to move, and the share is already my home directory for my existing Windows domain account.
if you directly mount this in your Red Hat /home/user you will temporarily lose everything that was inside /home/user including your settings (they are hidden and do a ls -a to see all of them) typically, .bashrc, .bash_profile etc.., these files are read by system when login in a user. also mounting anything there will most probably change the owner too hence rendereing your login attempts useless.
I suggest you make a separate directory under /home/user, something like /home/user/myShare then mount your share there with smbmount
Code:
smbmount //server/share /home/user/myShare -o username=user
or if you want you can make the system automatically mount the share on each boot by adding a line for it in /etc/fstab.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
why email INBOX directory is in /var/spool/mail instead of /home/username csjonathan Linux - General 4 11-06-2008 01:14 PM
Writing a script to backup up /home/username ginda Programming 3 01-05-2006 06:47 AM
using symlinks for /home/"username" and /var/www/html hamza11050 Linux - Networking 10 08-05-2005 10:36 PM
Xauth will not unlock a file at /home/username javpra Linux - Newbie 3 09-08-2004 07:36 PM
Squirrelmail not reading /home/username/Mail/Inbox di11rod Linux - Software 2 01-22-2004 06:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:20 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