LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-09-2011, 01:05 PM   #1
nuhbye
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Rep: Reputation: 0
Suppress password prompt in mount command. UBUNTU 10.04


I am trying to run this command from the super user mode which basically mounts the "nptel" share on "172.16.0.18" machine at "/test" on my machine.

mount -t smbfs //172.16.0.18/nptel /test

On running this command, it prompts for the password which i think is a part of mount command, password field takes any value(even if does not match).
I want to suppress this prompt, so that I can use it as a part of a script. how can I do that???

If not this way do i have any other way to make it a part of the script, where I don't have to enter password everytime???
 
Old 03-09-2011, 01:38 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
If you are mounting this share for reading only, then maybe it has set password for writing. In that case try to add "-ro" to your command to force read only access.
 
Old 03-09-2011, 02:35 PM   #3
SL00b
Member
 
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375

Rep: Reputation: 112Reputation: 112
You can supply credentials on the command-line with the user= and password= arguments.

Or, you can create a credentials file containing those two arguments, and reference it with the credentials= argument.

http://linux.die.net/man/8/smbmount
 
Old 03-10-2011, 04:47 AM   #4
nuhbye
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by SL00b View Post
You can supply credentials on the command-line with the user= and password= arguments.

Or, you can create a credentials file containing those two arguments, and reference it with the credentials= argument.

http://linux.die.net/man/8/smbmount
It still prompts for password.
 
Old 03-10-2011, 04:51 AM   #5
nuhbye
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by eSelix View Post
If you are mounting this share for reading only, then maybe it has set password for writing. In that case try to add "-ro" to your command to force read only access.
I tried using "-ro", but it is still prompting for password.

When it prompts for password, and if i press enter without entering right password or if enter anything else, it does not complains about the wrong password. It just excepts anything, but it always prompts.
 
Old 03-10-2011, 08:20 AM   #6
SL00b
Member
 
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375

Rep: Reputation: 112Reputation: 112
Quote:
Originally Posted by nuhbye View Post
It still prompts for password.
Please post your command string.
 
Old 03-10-2011, 03:09 PM   #7
agentbuzz
Member
 
Registered: Oct 2010
Location: Texas
Distribution: Debian, Ubuntu, CentOS, RHEL
Posts: 131

Rep: Reputation: 25
put the mount in /etc/fstab

You can put your Samba mount in /etc/fstab and point to a credentials file, like this:
Code:
//172.16.0.18/nptel /test     cifs    credentials=/etc/.smbpasswd 0 0
The content of /etc/.smbpasswd is like this:
Code:
username=AD_User
password=AD_password
Save /etc/fstab and do a "mount -a"
 
Old 03-12-2011, 03:17 AM   #8
nuhbye
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Original Poster
Rep: Reputation: 0
thanks all for the help...
I found one that works for me..

mount -t cifs //172.16.0.18/linux /test -o username=myusername,password=mypassword
 
Old 03-13-2011, 08:21 AM   #9
agentbuzz
Member
 
Registered: Oct 2010
Location: Texas
Distribution: Debian, Ubuntu, CentOS, RHEL
Posts: 131

Rep: Reputation: 25
samba mount

Yes, you can do that from the command line, but your mount won't be re-mounted at boot time. It would have to be entered in your fstab file to survive reboots.
 
  


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 suppress "Do you want to overwrite" prompt while using cp command gsvsmanyam Linux - Newbie 4 02-28-2010 02:07 PM
I wish to disable the password prompt in Ubuntu 8.10 magoo532 Linux - Newbie 6 04-15-2009 11:10 AM
FC9 Upgrade Woes: mount.cifs hangs after password prompt livnah Linux - Networking 0 06-13-2008 03:24 AM
How to provide password from command prompt ? p_s_shah Solaris / OpenSolaris 5 06-09-2008 07:59 AM
remote command over ssh, password prompt linowes Linux - General 2 10-27-2002 08:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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