How to use password with special character in mount command linux ?

I faced a problem while using mount command with a password containing special characters. The error that I got was “permission denied”. On analyzing the root cause, I figured out that because of the special character, the authentication failed.

The syntax of the mount command is given below.

> mount -t cifs -o username= ,password=[password] [windows-share-dir-path] [dir-in-linux]

Here my password was something like below. It has so many special characters.

> i2_Gw$wF?Xs4zq??K

Solution

The solution is simple. Create a text file and enter the credentials into that file.

I have created a file with the name credentials.ini

username=[username]
password=[password]

Now save this file and use this credentials file in the mount command. The syntax is given below.

mount -t cifs -o credentials=credentials.ini [windows-share-dir-path] [dir-in-linux]

 

Now execute this command and your problem will be solved. !!!!

About amalgjose
I am an Electrical Engineer by qualification, now I am working as a Software Architect. I am very much interested in Electrical, Electronics, Mechanical and now in Software fields. I like exploring things in these fields. I love travelling, long drives and music.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: