LinuxQuestions.org
Help answer threads with 0 replies.
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 07-05-2006, 09:41 AM   #1
RAdams
Member
 
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256

Rep: Reputation: 30
Mounting an smbfs using fstab


I'm trying to get a samba share to mount at startup. Here's my fstab entry:
Code:
//server/directory /mnt/sambashare smbfs credentials=/etc/samba/cred-file,uid=ronadams,gid=users,fmask=0770,dmask=0770 0 0
Here's my cred-file:
Code:
username right_username
password right_password
When I:
Code:
sudo mount -a
I get a prompt for a password, even if I've already run sudo just before. Entering my username password, the correct password for the share, and server/password (substituting the appropriate information) does nothing but get me:
Code:
6744: session setup failed: ERRDOS - ERRnoaccess (Access denied.)
SMB connection failed
Mounting using terminal commands to this directory works fine, as does using GNOME's network browser to get to it.

Any ideas?
 
Old 07-05-2006, 05:25 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927
I'd suggest adding a 'users' entry to the mount options, and
give the sudo-bit a miss. See whether a manual
mount /mnt/sambashare
works after that.


Cheers,
Tink
 
Old 07-06-2006, 01:28 AM   #3
RAdams
Member
 
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Tinkster
I'd suggest adding a 'users' entry to the mount options, and
give the sudo-bit a miss. See whether a manual
mount /mnt/sambashare
works after that.


Cheers,
Tink
What users entry should I add?

I have to sudo, to mount anything in the /mnt folder, unless this 'users' entry you speak of fixes that as well...
 
Old 07-06-2006, 01:31 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by RAdams
What users entry should I add?
He means to literally add the word "users" to the options list of the relevant line in your fstab.
 
Old 07-06-2006, 02:16 AM   #5
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
This sis what you want in your fstab
Code:
//server/directory /mnt/sambashare smbfs user,credentials=/etc/samba/cred-file,uid=rondams,gid=users,fmask=0770,dmask=0770 0 0
 
Old 07-06-2006, 02:51 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927
I actually said and meant users, because that way anyone can mount
and unmount, while with user only the person who mounted it can unmount it
again (and root, of course).


Cheers,
Tink
 
Old 07-07-2006, 08:44 AM   #7
RAdams
Member
 
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Tinkster
I actually said and meant users, because that way anyone can mount
and unmount, while with user only the person who mounted it can unmount it
again (and root, of course).


Cheers,
Tink
I used "users" as you suggested. It still isn't working. I'm thinking maybe my cred-file is incorrectly set up, but I'm not sure. Refer to above. (Yes, I am certain the username and password are correct.)

Some terminal output that might prove helpful:
Code:
ronadams@Foucalt:~$ sudo smbmount //wecco_serv/F_Drive /mnt/fdrive smbfs credentials=/etc/samba/cred-file,uid=ronadams,gid=users 0 0
Password:
6771: session setup failed: ERRDOS - ERRnoaccess (Access denied.)
SMB connection failed
ronadams@Foucalt:~$ sudo mount -a
Password:
6777: session setup failed: ERRDOS - ERRnoaccess (Access denied.)
SMB connection failed
ronadams@Foucalt:~$

Last edited by RAdams; 07-07-2006 at 08:57 AM.
 
Old 07-08-2006, 02:08 AM   #8
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
the command you want is:
Code:
sudo mount -t smbfs //wecco_serv/F_Drive /mnt/fdrive smbfs -o credentials=/etc/samba/cred-file,uid=ronadams,gid=users
You missed out the "-o" and you don't need "0 0" if mounting at the command line. Also it's best to run "mount -t smbfs" rather than smbmount
Quote:
Originally Posted by smbfs
This command is designed to be run from within /bin/mount by giving the option '-t smbfs'.
 
Old 07-09-2006, 11:23 AM   #9
RAdams
Member
 
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by binary_y2k2
the command you want is:
Code:
sudo mount -t smbfs //wecco_serv/F_Drive /mnt/fdrive smbfs -o credentials=/etc/samba/cred-file,uid=ronadams,gid=users
You missed out the "-o" and you don't need "0 0" if mounting at the command line. Also it's best to run "mount -t smbfs" rather than smbmount
What fstab entry is correct?
 
Old 07-09-2006, 12:19 PM   #10
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
My samba credentials file is formatted like
Code:
username=myUserName
password=myPassword
note the '=' on each line.

A bit of a long shot, but worth a shot.

--- rod.
 
Old 07-09-2006, 12:29 PM   #11
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
It's not clear to me that you are entering the right password at the right prompt. You do understand that each time you run sudo, you will need to enter a password (if it is configured to require a password, at all). So running
Code:
sudo mount -a
may require you to enter two passwords: one for sudo, and one for smbmount (actually a username + password).

I just want to clarify that you understand this concept.

In a similar vein, what happens if you run
Code:
mount -a
as root (not sudo)?

--- rod.
 
Old 07-10-2006, 02:11 AM   #12
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
in fstab put
Code:
//wecco_serv/F_Drive /mnt/fdrive smbfs credentials=/etc/samba/cred-file,uid=ronadams,gid=users 0 0
and to mount at the command line
Code:
sudo mount -t smbfs //wecco_serv/F_Drive /mnt/fdrive -o credentials=/etc/samba/cred-file,uid=ronadams,gid=users
You'll need to enter your linux password once for sudo. If you are asked for a username and/or password after than then you need to look at your credentials file.
Quote:
Originally Posted by theNbomr
In a similar vein, what happens if you run
Code:
mount -a
as root (not sudo)?
Ubuntu has the root user disabled by default, so you can't su to root etc. To get a root shell you have to do
Code:
sudo -i
 
Old 07-10-2006, 01:24 PM   #13
RAdams
Member
 
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by binary_y2k2
in fstab put
Code:
//wecco_serv/F_Drive /mnt/fdrive smbfs credentials=/etc/samba/cred-file,uid=ronadams,gid=users 0 0
and to mount at the command line
Code:
sudo mount -t smbfs //wecco_serv/F_Drive /mnt/fdrive -o credentials=/etc/samba/cred-file,uid=ronadams,gid=users
You'll need to enter your linux password once for sudo. If you are asked for a username and/or password after than then you need to look at your credentials file.

Ubuntu has the root user disabled by default, so you can't su to root etc. To get a root shell you have to do
Code:
sudo -i
Thank you, thank you. That worked wonderfully. I also incorporated the "username=foo" instead of "username foo" suggestion; I'm not sure if that helped or not (it certainly didn't hurt!). I'll test that later.

PS: Regarding logging in as root, one of the first things I do with any new Ubuntu install is
Code:
sudo passwd root
to allow root login. ;]

Cheers!
 
Old 07-10-2006, 01:55 PM   #14
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
I'm glad you got it to work
For the credentials file the man page says its in the format
username = <value>
password = <value>
(with spaces) but I guess it's a bit forgiving.
I know about "sudo passwd root" (was also the 1st thing I did) but not all users will have it so that's why i gave the sugestion "sudo -i" works well, you could even do "sudo bash"
 
Old 07-11-2006, 12:20 AM   #15
RAdams
Member
 
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by binary_y2k2
I'm glad you got it to work
For the credentials file the man page says its in the format
username = <value>
password = <value>
(with spaces) but I guess it's a bit forgiving.
Ah. Well, I suppose I better maintain the standards then... ;]

Quote:
I know about "sudo passwd root" (was also the 1st thing I did) but not all users will have it so that's why i gave the sugestion "sudo -i" works well, you could even do "sudo bash"
Gotcha.
 
  


Reply

Tags
error, fstab, samba


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Fedora Core 5 - Mounting smbfs in fstab Wheat_Thins Linux - Software 3 04-04-2006 02:27 PM
Broblem mounting an smbfs in fstab without username/pass and weird names polemon Linux - Networking 6 10-25-2005 12:17 PM
mounting an smbfs share using mount vs /etc/fstab sichen Linux - Networking 4 08-13-2004 06:40 PM
smbfs in fstab cpugeniusmv Linux - Networking 2 04-03-2004 01:29 PM
RH9 mounting SMBFS from fstab - Jefficus Linux - Networking 24 11-24-2003 04:14 PM

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

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