LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 05-28-2005, 02:20 PM   #16
kriidler
Member
 
Registered: May 2005
Location: Potchefstroom SA
Distribution: Slackware
Posts: 85

Original Poster
Rep: Reputation: 15

Quote:
type the following (as root or su to root):
Code:
mkdir /mnt/public
chmod -R 777 /mnt/public
mount //winserver/public /mnt/public -t smbfs -o username=kim,password=foo -o gid=users,dmask=777,fmask=777,rw
sorry, now i'm confused
ok, the being root I get, the making of the folders also. this username (kim) and password (foo), is that the username and password for the shared folder (P:\Public) on the windows pc or mine?
 
Old 05-28-2005, 02:44 PM   #17
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
It is an example. Re-read my post. Adjust usernames/servernames/passwords/sharenames/mountpoints/etc. as required.

Think of username kim as bar
think of password as zag
think of the mount point as nut

They're hypothetical examples so of course you will need to enter what is specific and correct for your environment.
 
Old 05-28-2005, 03:11 PM   #18
kriidler
Member
 
Registered: May 2005
Location: Potchefstroom SA
Distribution: Slackware
Posts: 85

Original Poster
Rep: Reputation: 15
OK. Let me see if I've got this:
On the Windows PC there's a folder C:\K's Stuff and the PC's name in netowrk neighborhood is PC2, Username = w, Password=Windows.
My username=k and password=kriidler on my Linux PC.
Say I want to mount it on my Linux PC on /home/k/stuff.

I need to:
su root
cd /home/k/
mkdir stuff
chmod -R 777 /home/k/stuff

and finaly

mount //PC2/K's Stuff /home/k/stuff -t smbfs -o username=k,password=kriidler -o gid=users,dmask=777,fmask=777,rw

or

mount //PC2/K's Stuff /home/k/stuff -t smbfs -o username=W,password=Windows -o gid=users,dmask=777,fmask=777,rw

?
 
Old 05-28-2005, 03:47 PM   #19
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
kriidler, don't take this the wrong way: I say this in kindness.

I hope that is hypothetical and not your real password because POSTING YOUR PASSWORD IS A STUPID THING TO DO. Please change your password if that is your real password. If you're on the 'net with that box, even through NAT, you've exposed yourself to additional risk of having your box "pwned"

However to answer your question:

First, you will need to escape the ' character and the space:
mount //PC2/K\'s\ Stuff

Secondly, you want to mount the WINDOWS share from your LINUX box. So, what you need to supply is the WINDOWS credentials. That means that the second example is the correct one, with the minor correction (escaping characters) required:

Code:
mount //PC2/K\'s\ Stuff /home/k/stuff -t smbfs -o username=W,password=Windows -o gid=users,dmask=777,fmask=777,rw
Also note: the "users" group for the gid= assumes that user "k" is a member of group "users".

Lastly, you can concatenate the options by replacing the " -o " before the gid= with a comma - I provided them separately in the example for the purpose of readability.
 
Old 05-28-2005, 04:36 PM   #20
kriidler
Member
 
Registered: May 2005
Location: Potchefstroom SA
Distribution: Slackware
Posts: 85

Original Poster
Rep: Reputation: 15
Hi KimVett.

No need to worry about the usernames, passwords, even most of the dirs is hypothetical

I've only gone over to Linux about a month ago and having worked on and with Windows for 16 years, I'm still thinking alot in windows terms.

So, I need to give the Windows username and password for the PC/Folder I want to mount.

Now, to unmount the folder, I'd use
Code:
 unmount /home/k/stuff
Can I put the mount and unmount code in a shell script?

K
 
Old 05-28-2005, 06:36 PM   #21
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Well to unmount it you type "umount" --- not unmount.

But yes, you can put it in a shell script. You may have to set mount and umount to be suid though.
 
Old 05-28-2005, 06:53 PM   #22
kriidler
Member
 
Registered: May 2005
Location: Potchefstroom SA
Distribution: Slackware
Posts: 85

Original Poster
Rep: Reputation: 15
suid ?
 
Old 05-28-2005, 07:34 PM   #23
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Sorry I'm about to leave for the night so I need to do this:

man -k suid

If you can't figure it out I'm sure someone else will be able to help you

Last edited by KimVette; 05-28-2005 at 07:35 PM.
 
Old 05-28-2005, 07:48 PM   #24
kriidler
Member
 
Registered: May 2005
Location: Potchefstroom SA
Distribution: Slackware
Posts: 85

Original Poster
Rep: Reputation: 15
Sleep tigh KimVett.

OK, I did [qoute] man -k suid [/quote] and am none the wiser.
Got something about getresuid and setresuid and something about real user ids?

Anyone?
K
 
Old 06-07-2005, 06:09 PM   #25
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
kriidler, did you ever get this working?
 
Old 06-07-2005, 06:51 PM   #26
kriidler
Member
 
Registered: May 2005
Location: Potchefstroom SA
Distribution: Slackware
Posts: 85

Original Poster
Rep: Reputation: 15
Hi KimVett.
Not as a shell script, I couldn't figure out the suid thing.
I have put the commands into 2 seperate scripts, one for mounting and one for unmounting, though I need to su root before I can use them.

There still seems to be a problem with the unmounting part of things, but I think that is a general thing with my setup. Whenever I want to unmount a device I have to use
Code:
umount -f -l <mount/point/path>
even with CDs and DVDs. Some times that doesn't even work and I have to reboot the PC.

K
 
  


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
Can't mount windows shares with smb4k Stevetgn Linux - Newbie 3 10-14-2005 12:51 AM
Shared Folders dudeman41465 Linux - Security 1 06-28-2005 06:38 PM
Shared Folders dudeman41465 Linux - Networking 2 06-27-2005 02:29 PM
Is auto-mount is possibble with smb4k? hope_tr Linux - Networking 1 12-01-2004 01:10 PM
Can Linux access WinXP's shared folder? davidas Linux - Newbie 5 04-17-2004 04:48 AM

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

All times are GMT -5. The time now is 10:09 PM.

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