Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
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.
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.)
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}
}
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.