LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-07-2009, 11:59 AM   #1
miros84
Member
 
Registered: Aug 2009
Location: Spain
Distribution: Debian stable, squeeze
Posts: 501

Rep: Reputation: 31
Add password to mount


Hello
I can mount in bash with this command

Code:
mount -t //xx.xx.xx.x.x/folder /mnt/somefolder
and when I type it in bash I recive:

Code:
password
then I type enter (I dont put password, just press enter) and my remote folder is mounted!

But when I add
Code:
mount -t //xx.xx.xx.x.x/folder /mnt/somefolder
to fstab, it is not mounted. So I think I must add this enter command in the line above.
But How?
Any help?
 
Old 09-07-2009, 12:24 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982
Well firstly those two commands are identical, and also invalid. -t is to define the filesystem type, e.g. ext3, cifs... and you've not done that, so that command as quoted should give an error. From the format of the source, it looks like a cifs share, and if there's no password "-o password=" should cover it.
 
Old 09-07-2009, 12:28 PM   #3
miros84
Member
 
Registered: Aug 2009
Location: Spain
Distribution: Debian stable, squeeze
Posts: 501

Original Poster
Rep: Reputation: 31
Yes, I just forgot to type cifs, so must be

Code:
mount -t cifs //xx.xx.xx.x.x/folder -o password='' /mnt/somefolder
Is that ok?
 
Old 09-07-2009, 12:37 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982
You tell me... does it work?
 
Old 09-07-2009, 12:40 PM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198
Dunno. Had a look at the mount.cifs man page an it wasn't clear. Try it. acid_kewpie suggested -o passwd= rather than -o password='' so I'd try that first.

When you're posting stuff that appeared on your screen, you can copy and paste it to ensure it's exact.

The X way is to highlight the text to copy and then put the mouse cursor where you want to paste and click middle mouse (or scroll wheel on a two button mouse).

The other way is to highlight the text to copy and then use Shift+Ctrl+C to copy it and then Ctrl+V to paste.
 
Old 09-07-2009, 12:52 PM   #6
miros84
Member
 
Registered: Aug 2009
Location: Spain
Distribution: Debian stable, squeeze
Posts: 501

Original Poster
Rep: Reputation: 31
I tried

Code:
mount -t cifs //xx.xx.xx.x.x/folder -o password='' /mnt/somefolder
Code:
mount -t cifs //xx.xx.xx.x.x/folder -o password=" /mnt/somefolder
Code:
mount -t cifs //xx.xx.xx.x.x/folder -o password="" /mnt/somefolder
then I type mount -a in terminal, and it says: Line 14 is not valid line. This is the line above. So, for now it is not working.
Other advice?

I tried also -o passwd="" and no luck

Last edited by miros84; 09-07-2009 at 12:56 PM.
 
Old 09-07-2009, 03:15 PM   #7
miros84
Member
 
Registered: Aug 2009
Location: Spain
Distribution: Debian stable, squeeze
Posts: 501

Original Poster
Rep: Reputation: 31
Must be

Code:
//xx.xx.xx.x.x/folder /mnt/somefolder cifs   defaults,rw,auto  0   0
That why I had errors.
But I still dont know how to add user and password

How it works ok

Last edited by miros84; 09-07-2009 at 03:16 PM.
 
Old 09-07-2009, 03:36 PM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198
Why don't you try acid_kewpie's suggestion of
Code:
mount -t cifs //xx.xx.xx.x.x/folder -o password= /mnt/somefolder
 
Old 09-07-2009, 04:04 PM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,843

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
Use the guest option, so you'll not be prompted for a password:
Code:
mount -t cifs //xx.xx.xx.x.x/folder /mnt/somefolder -o guest
 
Old 09-08-2009, 04:39 AM   #10
miros84
Member
 
Registered: Aug 2009
Location: Spain
Distribution: Debian stable, squeeze
Posts: 501

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by bathory View Post
Use the guest option, so you'll not be prompted for a password:
Code:
mount -t cifs //xx.xx.xx.x.x/folder /mnt/somefolder -o guest
That doesnot work. Please note I put that in fstab file.
It is not need to put mount -t in fstab.

I got it works this way:

Code:
//xx.xx.xx.x.x/folder /mnt/somefolder cifs   defaults,rw,auto  0   0
 
  


Reply


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
How to add an user, without password?? cenzole Linux - Newbie 22 12-25-2017 06:05 PM
Add a user and password in C? jcafaro10 Programming 3 04-10-2009 08:51 AM
add su password themanwhowas Linux - General 5 09-10-2007 05:09 PM
add a user with password without prompt grendel-IT Linux - Software 7 09-27-2006 02:07 PM
Add New User with Password canuck_barlow Linux - Newbie 1 09-25-2006 02:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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