View previous topic :: View next topic |
Author |
Message |
d4h0od Tux's lil' helper
Joined: 27 Jun 2002 Posts: 80 Location: Europe => Sweden => Blekinge => Karlskrona => h0odet
|
Posted: Fri Jul 12, 2002 5:02 pm Post subject: smbmount |
|
|
do i have to emerge entire samba package to be able to use smbmount?
isnt there anyway to install only smbmount and other utils need to mount a samba share... i dont want to run samba server myself
when i used debian before then i only had to do apt-get install smbfs
but cant find any smbfs package in gentoo _________________ // d4h0od |
|
Back to top |
|
|
roXet n00b
Joined: 27 Jun 2002 Posts: 26
|
Posted: Fri Jul 12, 2002 9:32 pm Post subject: |
|
|
I believe the 'entire samba package' is what allows you to mount windows file shares. If you don't have it running you won't be able to see the shares, so smbmount will pretty much be useless. |
|
Back to top |
|
|
delta407 Bodhisattva
Joined: 23 Apr 2002 Posts: 2876 Location: Chicago, IL
|
Posted: Fri Jul 12, 2002 10:06 pm Post subject: |
|
|
Just enable "SMB file system support (to mount Windows shares etc.)" under "Network filesystems" (under "File system support") in your kernel configuration and "mount -t smbfs //machine/share /mnt/point". _________________ I don't believe in witty sigs. |
|
Back to top |
|
|
roXet n00b
Joined: 27 Jun 2002 Posts: 26
|
Posted: Sat Jul 13, 2002 4:42 pm Post subject: |
|
|
so you don't have to install samba to do that? Only if you want to share file to a windows client. Ok, I was confused. =) |
|
Back to top |
|
|
reverius42 Apprentice
Joined: 16 Jul 2002 Posts: 166 Location: Tucson, AZ
|
Posted: Tue Jul 16, 2002 11:44 pm Post subject: Samba vs. smbfs |
|
|
roXet wrote: | so you don't have to install samba to do that? Only if you want to share file to a windows client. Ok, I was confused. =) |
In Debian, when you apt-get install smbfs, it's not really getting any part of samba... it's getting the necessary filesystem stuff to mount an SMB filesystem (and possibly the smbmount binary, i'm not sure). Anyways, you don't need that on Gentoo because of a few things:
1) You're compiling your own kernel, so you just have to make sure that smbfs is enabled in some form
2) The smbmount binary is already there, apparently.
All you should have to do is "mount -t smbfs //host/share /mountpoint" _________________ Even a stopped clock gives the right time twice a day. |
|
Back to top |
|
|
Black666 n00b
Joined: 15 Jul 2002 Posts: 61 Location: Vienna (Austria)
|
Posted: Thu Jul 18, 2002 10:57 am Post subject: |
|
|
Somehow it's not working here.
I do a
Code: | mount -t smbfs //anecon007/mp3 /mounttest/ |
but all I get is
Code: | mount: wrong fs type, bad option, bad superblock on //anecon007/mp3, or too many mounted file systems |
I checked the W2K box and sharing and NTFS permissions are all to "Read for Everyone" so this should not be a permissions issue. I also typed this command as root...still no effect.
Any hints? |
|
Back to top |
|
|
reverius42 Apprentice
Joined: 16 Jul 2002 Posts: 166 Location: Tucson, AZ
|
Posted: Mon Jul 22, 2002 7:12 pm Post subject: mounting smbfs |
|
|
Black666 wrote: | Somehow it's not working here.
I do a
Code: | mount -t smbfs //anecon007/mp3 /mounttest/ |
but all I get is
Code: | mount: wrong fs type, bad option, bad superblock on //anecon007/mp3, or too many mounted file systems |
I checked the W2K box and sharing and NTFS permissions are all to "Read for Everyone" so this should not be a permissions issue. I also typed this command as root...still no effect.
Any hints? |
It's possible that I have the syntax wrong. Try "mount -t smbfs \\\\anecon007\\mp3 /mounttest". The backslashes are the Windows-style of doing network paths... you need twice as many because you have to escape them, or else they're interpreted by the shell.
If it says the same thing, then I don't know what to do... _________________ Even a stopped clock gives the right time twice a day. |
|
Back to top |
|
|
BradN Advocate
Joined: 19 Apr 2002 Posts: 2391 Location: Wisconsin (USA)
|
Posted: Mon Jul 22, 2002 9:14 pm Post subject: |
|
|
I've seen windows machines (2000 if I remember) get picky about what name you access them with (but that meant that accessing by IP usually didn't work, where by host name it did). |
|
Back to top |
|
|
mrchuckles Tux's lil' helper
Joined: 09 Jul 2002 Posts: 125 Location: Severn, MD
|
Posted: Tue Jul 23, 2002 2:07 pm Post subject: |
|
|
Quote: | I checked the W2K box and sharing and NTFS permissions are all to "Read for Everyone" so this should not be a permissions issue. I also typed this command as root...still no effect. |
Well, it sounds like permissions issue. The 'everyone' group includes the 'Guest' account, but it's disabled by default. To connect anonymously, you'll need to enable the Guest account, but I wouldn't if I were you. Try connecting with a username and password to see if that helps.
Code: | mount -t smbfs -o username=<username>,password=<password> //anecon007/mp3 /mounttest |
Also, make sure you have SMB support compiled in your kernel, and you have the module loaded (if that's how you set it up).
Let us know what happens. |
|
Back to top |
|
|
Terrible_Josh n00b
Joined: 25 Jul 2002 Posts: 9 Location: NJ
|
Posted: Thu Jul 25, 2002 4:22 am Post subject: |
|
|
try
mount -t smbfs -o username=whatever //host/share /mountpoint
It will prompt you for the password. |
|
Back to top |
|
|
d4h0od Tux's lil' helper
Joined: 27 Jun 2002 Posts: 80 Location: Europe => Sweden => Blekinge => Karlskrona => h0odet
|
Posted: Tue Aug 06, 2002 12:37 pm Post subject: |
|
|
i have tried everything above but i still get this error msg when i try to mount my share...
can it have something to do with the fact that i have enabled encrypted passwords on the samba server... is there anything i have to do different then...
bash-2.05a# mount -t smbfs \\\\amnesiated\\samba /tmp/
mount: wrong fs type, bad option, bad superblock on \\amnesiated\samba,
or too many mounted file systems
bash-2.05a# _________________ // d4h0od |
|
Back to top |
|
|
Tuna Guru
Joined: 19 Jul 2002 Posts: 485 Location: Berlin
|
Posted: Tue Aug 06, 2002 2:33 pm Post subject: |
|
|
first.. check if 'amnesiated' (the windows computer) is listed in /etc/hosts
then.. the syntax is indeed
Code: | mount -t smbfs -o username=<username> //amnesiated/samba /tmp/ |
so no \\/// kombinations or similar
and.. indeed enabling the kernel options does not seem to be sufficent to mount a windows share.. as stated in the mount manual 'mount -t smbfs' only invokes smbmount.
check if that file is there?
i had the same problem and emerging samba cured all my problems.. though i didnt like to install the whole samba package just for share access :/ |
|
Back to top |
|
|
d4h0od Tux's lil' helper
Joined: 27 Jun 2002 Posts: 80 Location: Europe => Sweden => Blekinge => Karlskrona => h0odet
|
Posted: Tue Aug 06, 2002 4:16 pm Post subject: |
|
|
added the host amnesiated to /etc/hosts but still get error msg
Code: |
bash-2.05a# mount -t smbfs -o username=d4h0od //amnesiated/samba /tmp/
mount: wrong fs type, bad option, bad superblock on //amnesiated/samba,
or too many mounted file systems
bash-2.05a#
|
i cant find smbmount anywhere on my system so im doing "emerge samba" now and see if that works... but i dont like it either to install the entire package just to mount a samba share _________________ // d4h0od |
|
Back to top |
|
|
d4h0od Tux's lil' helper
Joined: 27 Jun 2002 Posts: 80 Location: Europe => Sweden => Blekinge => Karlskrona => h0odet
|
Posted: Tue Aug 06, 2002 5:01 pm Post subject: |
|
|
now that i have emerged samba it seems to work.. almost...
when i do
Code: |
bash-2.05a# mount -t smbfs -o username=d4h0od,password=password //amnesiated/samba /tmp/
15822: session setup failed: ERRSRV - ERRbadpw (Bad password - name/password pair in a Tree Connect or Session Setup are invalid.)
SMB connection failed
bash-2.05a#
|
but when i dont supply password in the command line like this and it ask for my password and i type it in then it works...
Code: |
bash-2.05a# mount -t smbfs -o username=d4h0od //amnesiated/samba /tmp/
Password:
bash-2.05a#
|
im not sure but i guess that this can have something to do with the fact that i have encrypted passwords on the samba server and when i supply the password in the command it is sent in plain-text and when it asks for the password it gets encrypted as i type it in and send it to the samba server and then the samba server gets the correct password and grants me access... but as i said im not sure... nor do i know how to fix this so that i can automount the samba share everytime i start up gentoo...
is there anyone who has a solution ? _________________ // d4h0od |
|
Back to top |
|
|
ozric100 Tux's lil' helper
Joined: 23 Apr 2002 Posts: 136
|
Posted: Mon Aug 12, 2002 5:55 pm Post subject: |
|
|
put it in your /ect/fstab file
like this
//<server-name>/<share-name>[TAB]/<mount-point>[TAB]<mount-options>[TAB]0 0
You may have to put in username=foo passoword=bar in the options section, it wont show in process table, but will be plain text in the fstab so beware. Well you get the idea. |
|
Back to top |
|
|
eyevee99 Apprentice
Joined: 16 Apr 2002 Posts: 239
|
Posted: Fri Sep 20, 2002 9:19 pm Post subject: |
|
|
What mount options do you recommend? Do theyneed a file system setting? |
|
Back to top |
|
|
ozric100 Tux's lil' helper
Joined: 23 Apr 2002 Posts: 136
|
Posted: Fri Sep 20, 2002 10:43 pm Post subject: |
|
|
Yes, I must have been sleepy when I posted that. do a man on fastab and smb.conf most of the options are listed there. |
|
Back to top |
|
|
RageX n00b
Joined: 01 Sep 2002 Posts: 16
|
Posted: Sat Sep 21, 2002 4:42 am Post subject: |
|
|
just browsed the thread, so forgive me if i'm repeating someone.
i think you should be able to use mount -t smbfs so long as you have smb file system support configured in the kernel. i have both that and samba, so i'm not sure.
regardless, if you're using name of the comp to mount to, i'd add it to the hosts file with the matching ip then use:
mount -t smbfs -o username=user,password=pwd //comp/share /linux/box
make sure the mount point on the gentoo box exists.
hope that helps |
|
Back to top |
|
|
eyevee99 Apprentice
Joined: 16 Apr 2002 Posts: 239
|
Posted: Sat Sep 21, 2002 8:33 am Post subject: I have the following in my fstab |
|
|
Code: |
//pixelacuity.home.box/data /mnt/pixelacuity/data smbfs defaults,username=myuser,password=mypassword 0 0
//pixelacuity.home.box/sassy /mnt/sassy smbfs defaults,username=myuser,password=mypassword 0 0
//pixelacuity.home.box/smooch /mnt/smooch smbfs defaults,username=myuser,password=mypassword 0 0
|
The first option does not mount at startup, the other two do.
however, once booted typing:
mount -t smbfs -o username=myuser //pixelacuity.home.box/data /mnt/pixelacuity/data
Then enter mypassword.
and the share mounts correctly...
Any ideas why this doesn't mount correctly from /etc/fstab?
Also, I can't write to these shares... what options do I need to write to them as my general user? |
|
Back to top |
|
|
Shizatoga n00b
Joined: 19 Jul 2002 Posts: 16
|
Posted: Tue Sep 24, 2002 5:40 am Post subject: |
|
|
If you aren't using a password for your smb share you must put "" for your password, here a snip from my fstab:
Code: |
//cthulhu/distfiles /usr/portage/distfiles smbfs defaults,username=guest,password="" 0 0
|
As for setting user ownership for the shares use the uid option. Ex:
Code: |
smbmount //cthulhu/distfiles /foo -o uid=myuser
|
fstab ex.
Code: |
//cthulhu/distfiles /usr/portage/distfiles smbfs defaults,suid=myuser,username=guest,password="" 0 0
|
For more info do "man smbmount". Enjoy. |
|
Back to top |
|
|
eyevee99 Apprentice
Joined: 16 Apr 2002 Posts: 239
|
Posted: Tue Sep 24, 2002 6:41 am Post subject: thanks |
|
|
I have the password in fstab so that's fine. The suid=blah bit is what I was missing.
However it still doesn't explain why the first share isn't being registered at boot time (thought I can manually mount it after that). |
|
Back to top |
|
|
eyevee99 Apprentice
Joined: 16 Apr 2002 Posts: 239
|
Posted: Tue Sep 24, 2002 7:50 am Post subject: |
|
|
I added suid=myusername to the fstab entries...
I still do not have permissions on my normal user.
trying to copy to the directory give the following error "You do not have permission to write to this folder"
ideas? |
|
Back to top |
|
|
Shizatoga n00b
Joined: 19 Jul 2002 Posts: 16
|
Posted: Tue Sep 24, 2002 4:58 pm Post subject: |
|
|
Try putting your password in quotes (i.e. "mypassword" )
Can you post your new fstab entrie? Also can you give a "ls -l" of your smb mounted dir. |
|
Back to top |
|
|
eyevee99 Apprentice
Joined: 16 Apr 2002 Posts: 239
|
Posted: Wed Sep 25, 2002 11:27 am Post subject: |
|
|
here are the fstab entries:
Code: |
//pixelacuity.home.box/data /mnt/pixelacuity/data smbfs defaults,suid=myuser,username=myuser,password=mypassword 0 0
//pixelacuity.home.box/sassy /mnt/sassy smbfs defaults,suid=myuser,username=myuser,password=mypassword 0 0
//pixelacuity.home.box/smooch /mnt/smooch smbfs defaults,suid=myuser,username=myuser,password=mypassword 0 0
|
First entry never mounts at startup, but can be mounted at the prompt.
Normal user does not have permissions on these shares, only root.
password without quotes must be the correct way to enter it, else the second two shares wouldn't mount either.
NOTE: suid uses my linux username, username/password use my logins on the winxp box. |
|
Back to top |
|
|
474 l33t
Joined: 19 Apr 2002 Posts: 714
|
Posted: Wed Nov 06, 2002 5:02 pm Post subject: Close to cracking it, but ... |
|
|
eyevee99 wrote: | here are the fstab entries:
Code: |
//pixelacuity.home.box/data /mnt/pixelacuity/data smbfs defaults,suid=myuser,username=myuser,password=mypassword 0 0
//pixelacuity.home.box/sassy /mnt/sassy smbfs defaults,suid=myuser,username=myuser,password=mypassword 0 0
//pixelacuity.home.box/smooch /mnt/smooch smbfs defaults,suid=myuser,username=myuser,password=mypassword 0 0
|
First entry never mounts at startup, but can be mounted at the prompt.
Normal user does not have permissions on these shares, only root.
password without quotes must be the correct way to enter it, else the second two shares wouldn't mount either.
NOTE: suid uses my linux username, username/password use my logins on the winxp box. |
Annoying, isn't it? A couple of points:
Firstly, the suid option seems to have no effect on smbfs. The options you should be using are uid and gid. I also recommend storing your username and password in a file (called smbpasswd for example), rather than fstab (if you really wanted to be secure you I suppose you could enable the CryptoAPI in your kernel and mount a small loopback block device to store the passwords on). Here's an example of such a file: Code: | username=myusername
password=mypassword |
You can then use the credentials option to point to that file. So your fstab line should look something like this: Code: | //pixelacuity.home.box/data /mnt/pixelacuity/data smbfs uid=myuser,gid=myuser,users,credentials=/path/to/smbpasswd 0 0 |
The users option will allow you to mount and unmount it as an ordinary user, and the uid/gid options will ensure you have the correct permissions (you can also use fmask and dmask to set the permission bits for files and directories contained inside the share from the point of view of how it appears in your Linux filesystem). The uid/guid is referrering to your SMB username/password, not your Linux username/password (see man smbmount).
Now here's the real problem: using /etc/fstab or mount -smbfs do give the same results. If you set up fstab as I said, you will have a successful mount as an ordinary user, and you will be able to unmount it.
BUT: you will *not* be able to create new folders/directories at the root of your mounted smb filesystem! However, you will be able to create and modify new directories and files under any existing directories inside the filesystem, if any are present
Why is this? Well, in my case I made a folder called /home/kerin/smb/home. I set up a fstab line with the options I spoke of, which will mount to that directory. Now, if I look at the permissions of the mount point before mounting as kerin, they look like this: Code: | drwxr-xr-x 1 kerin kerin |
Good. Now I do a mount /home/kerin/smb/home. Great, it works. Now everything's fine inside the filesystem mount point, but if I check the permissions of the mount point again they look like this: Code: | dr-xr-xr-x 1 kerin kerin |
See how the w bit got dropped. That mask on the directory now prevents me from modifying or creating new files and directories in /home/kerin/smb/home, but because I specified the uid/gid options, I have no problem in, say, /home/kerin/smb/home/someotherfolder.
This is really bad. If you mount as root, it preserves the mask the way it is (and should be), but if you mount as an ordinary user, that one difference makes it impossible to manipulate the effective "root" directory of your mounted filesystem!
When you unmount, the mask goes back to the way it was. I have tried and failed to find a way of preventing this behaviour. If there is no workaround, it seems to me that this makes truly seamless integration into a Windows network pretty much impossible. One should not have to be root to do this, but it's the only way around it that I've found so far.
Does anyone know any better? |
|
Back to top |
|
|
|