Link to home
Start Free TrialLog in
Avatar of serg2626
serg2626

asked on

How to create a password file in CentOS

Hello,
Can someone please tell me how I can create a password file in CentOS?

Heres a little history of the issue. My domain has a minimum password length of 14 characters with complexity. I am trying to create a cifs share in CentOS that will map a CentOS directory to a Windows share. For some reason, when I try to mount the windows share, it says that the Password is too long and does not allow me to create the mount because it does not authenticate the user. I have heard in other articles that there is a way to overcome this by creating a password file and referencing that file in the mount command on CentOS. Any suggestions? I would like to see the commands on how to create the password file and what should be included in the mount command to finally mount the windows share.

Thank you..
Avatar of edster9999
edster9999
Flag of Ireland image

The password file is plain text.
Uggghhhhh.  Sorry I shuddered just thinking about that.

In the mount command you would put something like

credentials=/root/cifspasswd

The plain text file then conatins :
username=value
password=value

so you could creat the file by doing :
echo "username=serg2626" > /root/cifspasswd
echo "password=MySecRet#PassWord999" >> /root/cifspasswd

The bad news is that is pretty much as secure as it gets.  Your login password just sigging in a file.
You should of course set the rights on the file so only you (root) can read it
chmod 400  /root/cifspasswd

Avatar of serg2626
serg2626

ASKER

Can you give me the full mount command that I would enter. Assume that the target linux directory is called "backups" and the windows share is called "\\test\share".

Thank you again..
ASKER CERTIFIED SOLUTION
Avatar of edster9999
edster9999
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial