LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 12-20-2010, 08:51 AM   #31
sirgt
LQ Newbie
 
Registered: Jul 2005
Posts: 1

Rep: Reputation: 0

I had the same on two servers, the problem was that the account was asking for a password change at next logon. Took that off and everything is ok now.
 
Old 12-20-2010, 10:24 AM   #32
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,150

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Since this thread seems to have lots of hints, here's another one: The domain can (should?) be specified in the credentials file:
Code:
$ cat .smb_credentials 
username=Peter Trenholme
password=<redacted>
domain=TRENHOLME
 
Old 01-14-2011, 06:26 AM   #33
ceebster
LQ Newbie
 
Registered: Jan 2011
Posts: 2

Rep: Reputation: 0
Hi Guys - my first post

This post was brill - mounting made simple.

my next task is to permantly to mount it - struggling with the code to get this to work - by editing fstab.

Any genius' out there can help?

Cheers


Chris
 
Old 01-14-2011, 08:03 AM   #34
ceebster
LQ Newbie
 
Registered: Jan 2011
Posts: 2

Rep: Reputation: 0
Followed this - worked a treat

http://www.thatsquality.com/articles...res-using-cifs
 
Old 09-06-2011, 08:46 AM   #35
morrighu
LQ Newbie
 
Registered: Sep 2011
Posts: 1

Rep: Reputation: Disabled
Cool Just In Case This Helps Someon Else

First: sudo apt-get install cifs-utils

Your credential file should look like this, if you use a workgroup rather than a domain:

username=My User Name Here
password=mypasswordhere234!@#$
workgroup=MYWORKGROUPNAME

If you use a domain, change workgroup to domain and put your domain name in.

As other users have noted, DO NOT USE SPACES UNLESS THERE ARE SPACES IN THE USER NAME, ETC. (e.g. user name is "Linda Sue" so username=Linda Sue would be correct but username=LindaSue will not work.)

Then you can execute something like this:

mount.cifs //$server/$share /media/$share -o credentials=$pathandfile

WHERE $server = netbios name or IP address of the server
$share = share nameso that so that
$pathandfile = /path/to/credentialfilename

That works for me where as mount -t cifs did not. I'm running Natty Narwhal so this might to be due to newer versions.
 
Old 09-06-2011, 11:30 AM   #36
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,150

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
And, if you want it in your /etc/fstab, something like this might work:
Code:
//192.168.0.4/Documents /cifs/Documents cifs noauto,uid=Peter,gid=Peter,credentials=/home/Peter/.smb_credentials,rw 0 0
//192.168.0.4/FEBE      /cifs/FEBE      cifs noauto,uid=Peter,gid=Peter,credentials=/home/Peter/.smb_credentials,rw 0 0
//192.168.0.4/Public    /cifs/Public    cifs noauto,uid=Peter,gid=Peter,credentials=/home/Peter/.smb_credentials,rw 0 0
Note: I use "noauto" so the Linux boot won't halt when the server is down for some reason, and have my /etc/rc.d/rc.local script run the mount commands if the connection is available. Here's the bash function I use for that purpose:
Code:
#############################################################################
#
# Mount all "noauto" cifs devices in /etc/fstab that exist and are not already
# mounted.
#
#############################################################################
mount_cifs() {
  echo
  echo "Mounting any \"noauto\" cifs devices found in /etc/fstab."
  n_mounted=0
  Ping
  if [ $? -ne 0 ]
  then
    echo "  No network connection is available. Mounting of cifs devices aborted."
    return
  fi
  cifs=$(gawk '$0 ~"^[[:space:]]*[#]" {next}; $0 ~ "[[:space:]]cifs[[:space:]].*noauto" {print $2}' /etc/fstab)
  if [ -n "${cifs}" ]
  then
    for name in ${cifs}
    do
      mounted=$(mount | gawk -v name="${name}" '$0 ~ name {print "yes"}')
      if [ -z "${mounted}" ]
      then
        sucmd mount ${name} &>/dev/null
        if [ $? -eq 0 ]
        then
          echo "  ${name} mounted."
          n_mounted=$((++n_mounted))
        else
          echo "  Failed to mount ${name}."
        fi
      else
        echo "  ${name} is already mounted."
      fi
    done
    [ ${n_mounted} -eq 0 ] && echo "   No unmounted \"noauto\" cifs devices were mounted."
  else
    echo "    No cifs \"noauto\" devices were found in /etc/fstab."
  fi
}

#############################################################################
#
# Test for an active network connection by pinging $1 or, if $1 is null, google.com
#
#############################################################################
Ping() {
  local uri
  [ -n "${1}" ] && uri="${1}" || uri="google.com"
  ping -c 1 "${uri}" &>/dev/null
  return $?
}

#############################################################################
#
# Run a command as "root" and return its returned value
#
#############################################################################
sucmd() {
  local error_code, sucmd
  if [ $(id -u) -eq 0 ]
  then
    sucmd=
  else
    sucmd="sudo"
  fi
  ${sucmd} $*
  error_code=$?
  return ${error_code}
}
 
Old 01-30-2012, 03:06 PM   #37
lostlinlinux
LQ Newbie
 
Registered: Jan 2012
Distribution: Ubuntu
Posts: 2

Rep: Reputation: Disabled
FSG share login

I had the same problem logging in to my fsg shares, i eventually found the issue. Whilst the username and password where correct (i use an .smbcredentials file) the user group on the fsg did not have access thus the problem existed.
I have an automount in the fstab that change the user permissions from the default to the required user access using uid=usernumber, gid=groupidnumber
 
Old 04-03-2012, 08:50 PM   #38
pranablinux
LQ Newbie
 
Registered: Sep 2007
Posts: 1

Rep: Reputation: 0
The error above is because of a bug in kernel which got in to the kernel version 2.6.18 and above. The same mount command works great for the kernel version 2.6.17 and below.
Working mount command irrespective of the bug is as below.

$mount -t cifs //win-share-hostname/share /mnt/win -o username=user,password=passwd,domain=xxx
 
Old 10-12-2012, 12:29 PM   #39
merlin76
LQ Newbie
 
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
As I read on the post trying to match a solution, the man page (man mount.cifs) gave me a clue to a --verbose option before the options switch, I appreciate all others efforts to solve the problem they gave me clues as to were to look. Here is my solution:

issuing command with --verbose option
Code:
$mount -t cifs //<MachineName>/<SharedFolder> /mnt/Shared --verbose -o username=<DomainName>\<username>,password=<password>,domain=<DomainName>,rw
Yielded results, allowing me to see a missing backslash on the user=domain\user option
Code:
$mount.cifs kernel mount options: ip=<IPaddress>,unc=\\<MachineName>\<SharedFolder>,,ver=1,user=<DomainName><username>,domain=<DomainName>,pass=********
the original command was fixed with an escape character to account for the missing backslash
Code:
$mount -t cifs //<MachineName>/<SharedFolder> /mnt/Shared -o username=<DomainName>\\<username>,password=<password>,domain=<DomainName>,rw
 
Old 10-30-2012, 11:10 PM   #40
theuean
LQ Newbie
 
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
In my case, I am mounting using smbfs and a credentials file in fstab, like so:

//192.168.x.x/sharename /home/username/mountpoint cifs credentials=/home/username/.smbcredentials 0 0

where .smbcredentials contains:

username=serveruser
password="servercomplexpassw()rd"

I consistently received permission denied errors. I created a new user on the server with a simpler password (no funny characters, thus no quotes) and it worked fine after that.

username=serveruser2
password=simplepassword
 
Old 10-31-2012, 08:50 AM   #41
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,150

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Did you try the fancy password without the quotes? My Windows user name contains a space character, and I needed to put it in the credentials file without the quotes to get it to work.

This is, in fact, a problem with some Samba tools. They helpfully add quotes to various things being sent to Windows systems which read the quoted string verbatim, and then the string fails to be acceptable at the Windows end. (Note: That's an assumption on my part. I have not verified it, except to remove the quotes from around my user name and a few other strings that Samba stores in my wallet.)
 
  


Reply

Tags
cifs, mount, mountcifs, smbfs


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
Cifs "mount error 5 = Input/output error" but smbfs works! humbletech99 Linux - Networking 16 03-16-2014 05:54 PM
Acrobat Reader "error opening document - permission denied" Robhogg Linux - Software 5 04-25-2008 08:44 AM
Cifs "mount error 11 = Resource temporarily unavailable" humbletech99 Linux - Networking 1 09-26-2006 12:04 PM
cifs - "READ ERRORS" snoopy78m Linux - Networking 1 06-15-2006 10:01 AM
"permission denied" error when cron job executes jillu Linux - Newbie 11 11-02-2004 01:19 PM


All times are GMT -5. The time now is 07:36 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration