LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-08-2008, 02:41 PM   #1
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458

Rep: Reputation: 30
Mounting Windows share


I am trying to mount a windows share to an Ubuntu 7.10 workstation and am having some issues. If I go into Nautilus and enter the following into the Location bar I have no problem and can see my files:
Code:
smb//172.16.4.23/users/my_name
I need to enter my username, password, and domain at the next prompt, but it then works.

I would like to just add an entry into etc/fstab so that at boot it is mounted to /server; however, I only get a permission denied when I try as such:
Code:
//172.16.4.23/users/todd_parks	/server	smbfs	defaults	0	0
I get:
Code:
5784: session setup failed: ERRDOS - ERRnoaccess (Access denied.)
SMB connection failed
How can I set this up so that I can auto mount it at startup?

Thanks,
Todd
 
Old 04-08-2008, 07:33 PM   #2
kyriakos
Member
 
Registered: Dec 2005
Location: Greece, Xanthi
Distribution: Red Hat 9, FreeBSD 5.4
Posts: 38

Rep: Reputation: 15
try
smbclient //host/share password -U user

and read man smbclient and smbmount

if you manage with smbclient then just put it in /etc/rc.local
 
Old 04-11-2008, 01:58 PM   #3
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458

Original Poster
Rep: Reputation: 30
Thanks for the reply; however, it is still not working. When I try it your way I get:
Code:
session setup failed: NT_STATUS_LOGIN_FAILURE
As far as I can see by the man pages I am doing it correctly (obviously I am not though...)

Any other thoughts? I would love to be able to use Linux at work, but if I cannot connect to the server it won't happen

Thanks,
Todd
 
Old 04-11-2008, 02:29 PM   #4
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458

Original Poster
Rep: Reputation: 30
I also tried:
Code:
sudo mount -t cifs //wollemi/users/me /server --verbose -o user=me
and I get:
Code:
mount.cifs kernel mount options unc=//wollemi\users,ip172.16.4.23,pass=password,ver=1,rw,user=me,prefixpath=me
mount error 20 = Not a directory
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
I looked at the man pages, but again, I cannot see what I am doing wrong.

Thanks,
Todd
 
Old 04-11-2008, 02:55 PM   #5
p_s_shah
Member
 
Registered: Mar 2005
Location: India
Distribution: RHEL 3/4, Solaris 8/9/10, Fedora 4/8, Redhat Linux 9
Posts: 237
Blog Entries: 1

Rep: Reputation: 34
Check the link :

http://kbase.redhat.com/faq/FAQ_71_3420.shtm
 
Old 04-11-2008, 03:13 PM   #6
dbmacartney
Member
 
Registered: Mar 2007
Location: London, UK
Distribution: Debian, Red Hat Enterprise, Fedora
Posts: 70

Rep: Reputation: 15
you mentioned using nautilus. are you only wanting to use is as the user which is currently logged in? you can go to your places menu and click connect to server. this wont give you your traditional mountpoint though. but you've almost got it.

the command to run is
sudo mount -t cifs -o username=me //server/share /path/to/mountpoint

to add it persistently after a reboot you need to have a credentials file where you save your username and password to.

eg:
//server/share /mnt/share cifs defaults,credentials=/root/.credentials 0 0

make sure your .credentials file is only readable by root, you dont want your password being found by any other user.


alternatively if you wish to have it mounted when an individual profile is loaded, you can use a login script.
check out the below link, it describes some good details about automatic mounting of SMB shares.


http://wiki.awkwardtv.org/wiki/Mount..._a_StartupItem
 
Old 04-11-2008, 03:16 PM   #7
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458

Original Poster
Rep: Reputation: 30
I tried that and got the error message:
Code:
6686: session setup failed: ERRDOS - ERRnoaccess (access denied.)
SMB connection failed
Thanks,
Todd
 
Old 04-11-2008, 03:16 PM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
First, make sure to use "smbpasswd" to add an entry of the windows user to /etc/samba/smb.conf.
Then use the credentials option to refer to a credentials file containing your using name and password in
Code:
username=<yourusername>
password=<yourpassword>
form.
Put the password somewhere safe such as /home/<yourusername>/.credentials. Make sure it is readable only by you and that you don't allow global access to your personal home directory.
Also use "cifs" as the filetype in /etc/fstab.

If the remote share is on a Vista machine, make sure that Samba is updated to a recent version.
Also check that you are using the correct credentials for the share.

Last edited by jschiwal; 04-11-2008 at 03:18 PM.
 
Old 04-11-2008, 03:39 PM   #9
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458

Original Poster
Rep: Reputation: 30
In doing that (trying to set a password) I get the message:
Code:
Could not connect to maching 127.0.0.1: NT_STATUS_LOGIN_FAILURE
Failed to change password for tparks
I will actually need to add a user to Samba as I have a different username to log into the Windows server than the one that I use to login to my local machine.

I appreciate the insight. Can you guide me a bit more in getting Samba set up? I will not be able to do much more for a couple of weeks as I am leaving town for a week and will not have access to this computer. Just don't want anyone to think that they are getting ignored as I appreciate all of the help given to me

Thanks,
Todd
 
Old 04-11-2008, 05:37 PM   #10
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Look at the "-a" option to smbpasswd. It will add and entry rather than just change one. You will need to point to a credentials file in your /etc/fstab entry that uses the credentials of that windows user rather than your own linux user. If you are sharing files back and forth, having the same username/password in both systems would be a good idea. When accessing the Samba server, the user trying to write the samba share needs Linux permissions to do so. If that user is not a Linux user, the share needs to allow guest access and "bad user = guest" needs to be used in smb.conf.

I'd recommend using swat to set up the samba server.
First you need to enable the swat service (i.e. enable it in /etc/xinetd.d/swat). If your system uses chkconfig you can use:
sudo /sbin/chkconfig swat on. This will remove the top "disable = yes" line. When you are done you can use "sudo /sbin/chkconfig swat off". This will add "disable = yes" to the top off the swat config file.
Then point your web browser to "http://localhost:901".
 
Old 04-12-2008, 08:36 AM   #11
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458

Original Poster
Rep: Reputation: 30
I appreciate the advice and as soon as I get back in a week I will try out what you recommend. I wanted to use the same username/password combination on my laptop as on the server for the reasons that you stated; however, my username on the windows server has an underscore (_) in it and when I tried to use that as a username in Ubuntu, the system complained. Hence the reason that I have different usernames.

Seems strange that I can browse to the Windows server and see all of my files with no problem using Nautilus yet I am having to jump through hoops to get it mounted. Ah well, look at all that I am learning...

Thanks again,
Todd
 
  


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
Trouble mounting Windows share luckythedonkey Linux - Newbie 2 04-03-2006 01:33 PM
mounting windows share with samba? lilili Linux - Software 2 03-08-2006 03:10 AM
Mounting hidden windows share ashjam10 Linux - Networking 1 11-12-2005 10:11 PM
mounting a windows share w/ rw permissions GaijinPunch Linux - Networking 8 01-06-2004 07:04 PM
mounting a windows network share? graystarr Linux - Networking 2 11-09-2002 05:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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