Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458
Rep:
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:
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458
Original Poster
Rep:
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.
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.
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.
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.
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458
Original Poster
Rep:
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
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".
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458
Original Poster
Rep:
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...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.