LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-20-2008, 03:52 PM   #1
GLogic
LQ Newbie
 
Registered: May 2008
Posts: 6

Rep: Reputation: 0
trying to mount as user


Hi all,

So I have a directory that I'm sharing from one linux server via samba.
I'm able to view all files on it from any window box fine

@net use U: \\192.168.1.100\import * /user:worker /no

But, when I try to mount from my other linux box it is unable to view any files that are read/writeable only by user worker (although I'm able to see any other files as normal)

-rwxr--r-- 1 worker users 110 May 2 07:53 TDATE.log

I tried:
sudo mount -t cifs //192.168.1.100/import /mnt/import -o user=worker
sudo mount -t cifs //192.168.1.100/import /mnt/import -o user=worker,uid=worker,gid=users
( as well as trying combinations in between)


sudo mount -t cifs without "-o user" ... and ...
sudo mount -t smbfs //192.168.1.100/import /mnt/import -o user=worker both give me an error
mount: wrong fs type, bad option, bad superblock on //192.168.1.100/import, missing codepage or helper program, or other error


Does anyone out there know why this is happening? I'm confused because I would expect if mount wasn't mounting as worker, then it wouldn't mount. But it can only see the files that are readable by other/group, which seems completely counter intuitive to me. Is there a way I can tell what user I'm mounted as (besides using mount -l)?

Thanks all in advance for any help you can give!

Last edited by GLogic; 05-20-2008 at 03:56 PM.
 
Old 05-20-2008, 04:02 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by GLogic View Post
Hi all,

Is there a way I can tell what user I'm mounted as (besides using mount -l)?
Try:

sudo whoami

------------------
Steve Stites
 
Old 05-20-2008, 04:14 PM   #3
GLogic
LQ Newbie
 
Registered: May 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Hi Steve,

I'm sorry, that doesn't make sense to me. That's going to be root no matter what box I try it on, and I don't understand how that would apply to the mount. Let me try to clarify: linux box 2 has mounted a directory on linux box 1 (that is being shared using samba). I tried to do so by using the user "worker" on linux box 1, but when navigating through the mount point I am unable to access files read/writeable only by "worker". Does that make sense?

Thanks!!!
G.

Quote:
Originally Posted by jailbait View Post
Try:

sudo whoami

------------------
Steve Stites
 
Old 05-20-2008, 04:37 PM   #4
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
You can always use sudo if you don't want to be root.
 
Old 05-20-2008, 05:30 PM   #5
GLogic
LQ Newbie
 
Registered: May 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jay73 View Post
You can always use sudo if you don't want to be root.

True, but that's not what I had a question about. I was just saying that using "sudo whomai" will return root, and doesn't, AFAIK, address my issue.


My issue was that I don't know how to verify what user I'm mounting to the remote disk as. The behavior is as if I'm mounting as some user other than "worker" even though I'm using the option "-o user=worker", and not using that option will fail. Also, using a bogus user "-o user=foo" will fail, giving

mount: block device //192.168.1.100/import is write-protected, mounting read-only
mount: cannot mount block device //192.168.1.100/import read-only


So, it dawned on me that I could touch a file and see who the owner is. What I see, appears about right to me. It, and all the files in //192.168.1.100/import are owned by "libuuid" which is the user with that uid on linux server 2.

Does the fact that the username for uid 100 is different on server 1 and server 2 have any bearing?
 
Old 05-20-2008, 07:01 PM   #6
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Quite possibly. Did you set up a sambapasswd for your user? Does he have an account on the server that perfectly matches the one on the client?
 
Old 05-21-2008, 10:31 AM   #7
GLogic
LQ Newbie
 
Registered: May 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jay73 View Post
Quite possibly. Did you set up a sambapasswd for your user? Does he have an account on the server that perfectly matches the one on the client?
Thanks Jay. That was it. The accounts didn't match up perfectly. A little tweaking of /etc/passwd on server 2 and I'm back in business.

Thanks again for the help!!!
 
  


Reply



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
How to give not-root user ability to mount devices to any mount point??? jdupre Linux - General 8 02-04-2012 10:03 AM
help please: mount -t smbfs -a fails as normal user, as root, doesn't mount anything thevic Linux - Networking 11 04-09-2007 03:09 AM
Mount ext3 partition in /home/USER/Documents with read/write/execute acces for USER anonymous234 Linux - Hardware 2 01-12-2007 12:23 PM
user cant mount after chmod 777 /bin/mount misterwiddle Linux - General 2 04-06-2005 05:36 PM
how to use 'mount' as user servnov Linux - Newbie 6 11-02-2004 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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