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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
07-05-2006, 09:41 AM
|
#1
|
Member
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256
Rep:
|
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:
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?
|
|
|
07-05-2006, 05:25 PM
|
#2
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
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
|
|
|
07-06-2006, 01:28 AM
|
#3
|
Member
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256
Original Poster
Rep:
|
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...
|
|
|
07-06-2006, 01:31 AM
|
#4
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Rep: 
|
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.
|
|
|
07-06-2006, 02:16 AM
|
#5
|
Member
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Rep:
|
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
|
|
|
07-06-2006, 02:51 AM
|
#6
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
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
|
|
|
07-07-2006, 08:44 AM
|
#7
|
Member
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256
Original Poster
Rep:
|
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.
|
|
|
07-08-2006, 02:08 AM
|
#8
|
Member
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Rep:
|
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'.
|
|
|
|
07-09-2006, 11:23 AM
|
#9
|
Member
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256
Original Poster
Rep:
|
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?
|
|
|
07-09-2006, 12:19 PM
|
#10
|
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
|
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.
|
|
|
07-09-2006, 12:29 PM
|
#11
|
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
|
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
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
as root (not sudo)?
--- rod.
|
|
|
07-10-2006, 02:11 AM
|
#12
|
Member
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Rep:
|
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
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
|
|
|
07-10-2006, 01:24 PM
|
#13
|
Member
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256
Original Poster
Rep:
|
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
|
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
to allow root login. ;]
Cheers!
|
|
|
07-10-2006, 01:55 PM
|
#14
|
Member
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Rep:
|
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"
|
|
|
07-11-2006, 12:20 AM
|
#15
|
Member
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 04:15 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|