Click to See Complete Forum and Search --> : Accessing Windows Shares With SAMBA - Passwords
I have a small home network (4 PC's) for my family.
The network is p2p, but with my Windows XP box doing DCHP and [dial-up] internet sharing.
I am testing Linux on one of them to see if migration to Fedora would be possible(currently all have Windows XP). A much used function by my family is file sharing. I have a large software archive on a public drive and all my family have their own network disks to back up any data.
When accessing Windows shares with Linux (Fedora) I have to entere a User Name and Password (Windows XP accesses Fedora shares fine). As the PC's automaticly log in, the User has no password (no, I cant add one, as the auto-login, dissables) so I have to use the Administrator Password for each machine. Is there a way to make SAMBA automaticly enter these passwords as it accesses the computer? Rather than have my family type the nessacary passwords all the time.
2 Limiting Factors : I dont want to change distro (I like Fedora, though I may get 2 or 3 when its released )
I will not be migrating the whole network at once, so I cant just install Linux on all of them and it will work. I need to show my family that a Linux Migration would be painless.
(I'm sorry if this is a RTFM question)
Icarus
10-15-2004, 09:24 AM
Originally posted by tarl
(I'm sorry if this is a RTFM question) Sounds more like a STFF (search the fine forums) ;)
You probably want to setup an fstab entry for the share. Did you want it to auto-mount at boot or when needed?
There are a couple posts on setting up fstab entries for samba, but the real key is NOT to put the username and password in the fstab (VERY insecure as fstab is world readable)
Here's an example (http://www.justlinux.com/forum/showthread.php?s=&threadid=129250&highlight=samba+fstab), look at FatTrev's answer for an example.
Ok, I think this bit will help:
could u modify your /etc/fstab to include the samba drives?
code: //yeti/tmp /mnt/samba/ credentials=/home/travis/.cred,uid=500 0 0
in .cred i have
code:username=meisenheimer
password=notlikely
But I'm not sure how to impliment it? I want the users to be able to just use the "Network Servers" option on the RedHat menu to see the shares (in this case Public).
I don't really mind having to leave the passwords in a publicly viewable file as my family 'know' them.
Should I migrate the network to Linux, I will also want to be able to automount on logon sub directories of Public, such as \\jason\public\mum (Jason being the server, Public the share, and mum being the sub-directory to mount as the drive).
Icarus
10-15-2004, 10:33 AM
You could use Nautilus to browse network shares simular to Windows Network Nieghborhood (or My Network Places) buy using "smb:\\\" for the address (there is a quick launch in RH 8 and 9 for network servers.
You could also look into LinNeighborhood which is simular also but you can use that to save usernames and passwords. Aslo there is smb4k which is a KDE based network browser.
As you can see, there are plenty of options...we just need to figure out what workds best for you :D
Yes, I have Nautilus (I remember crashing it when fiddling with the samba settings :confused: ). Its just that Fedora calls it "Network Servers" on the RedHat menu (I need that simplicity, I dont have much experiance with linux (but I have pleantly of experiane with networks), and my family, the prospective new users, have none!)
I want to be able to mount a sub-folder of a share, but I also want to be able to acess a Windows XP share (from Linux, using Nautilus) without having to type the password every time I connect. (someone said somthing about passwords in fstab not being secure - I dont mind, the users know them anyway!)
Then thing is I can access this box (called 'linux') from the rest of the network (Windows XP) but when I connect from Linux to another computer (eg 'jason', Windows XP), Nautilus/Samba asks for a password each time, can I have this auto-entered by samba, I dont mind having the passwords in a plain text file, un-encrypted, etc...
Thanks
Icarus
10-15-2004, 11:32 AM
Let's try this using that example. Let's set up the share so it is mounted at boot time (if the share is unavailable at boot time it will slow the boot time down, but will continue after the connection times out) Is this an 'always on' share?
In the /etc/fstab add a line simular to this
//servername/harename /mnt/samba/ credentials=/home/user/.cred,auto,uid=500 0 0
Then in the /home/user directory (where user is the users name) make a file called .cred
in .cred add two lines like this
username=windowsusername
password=windowspassword
to mount this without rebooting, open a console and su to root and type in
mount /mnt/samba
Ok, I did that, but...
[root@linux /]# mount /mnt/public
mount: fs type not supported by kernel
I had this problem before (with BasicLinux & CD-ROMS) do I need to load a kernal module?
Anyways, to clarify, I have attached a screenshot of the problem I am having with Nautilus, is there a way I can get that to automaticly enter the passwords (the passwords are different for the 3 computers I need to access)?
NB: If i type the admin password (for the Windows XP box) then it works ok.
Sorry for my stupidity, You have been extreemly helpful so far.
Icarus
10-15-2004, 12:36 PM
Ah, for this problem
[root@linux /]# mount /mnt/public
mount: fs type not supported by kernel
I think we forgot to add smbfs to the fstab line, so it should look more like
//servername/harename /mnt/samba/ smbfs credentials=/home/user/.cred,auto,uid=500 0 0
As for having Nautilus store logons, I don't know if you can. If anyone knows how, it would be good to know ;)
Bryon Speede
10-15-2004, 12:44 PM
Try adding smbfs to the filesystem field like so:
//servername/harename /mnt/samba/ smbfs credentials=/home/user/.cred,auto,uid=500 0 0
then mount /mnt/samba
edit: Woops, looks like I hit submit a couple seconds to late...
Thanks (Both of you) I now have it working for the mounted share. I just want to check, the 'auto' means that it will auto-mount right?
Also I am willing to try other network browsers if they will allow me to store passwords for me.
Thanks so much for the halp so far.
Icarus
10-15-2004, 01:01 PM
Originally posted by tarl
I just want to check, the 'auto' means that it will auto-mount right? Yes, auto means mount at boot time
'man mount' will give you tons of gorry details on mounting
The two browser I mentioned earlier support storing logons
LinNeighborhood (http://www.bnro.de/~schmidjo/)
SMB4K (http://smb4k.berlios.de/)
smb4k is pretty slick, if you can handle the KDE long enough (I'm not a big fan of KDE but there are a lot of good apps that uses it's interface)
Thanks
I tried LinNeigbourhood over the weekend, and have dowloaded SMB4K, which I may try (I use Gnome, and dont think I even have KDE installed). Anyway, its not really what I am looking for, from what I have discovered, it simply alows you to mount drives using a graphical interface (but you still need the password & server name to connect).
I think I will stick to Nautillus and see if I can tweak it to read the password from a plain text file on a per server basis.
Thanks anyways, the fstab auto-mounting instructions were most helpful.