A
A
Anatoly D2019-08-06 16:40:09
linux
Anatoly D, 2019-08-06 16:40:09

Is it safe to automatically mount DFS in Lubuntu 18.04?

Good afternoon, comrades.
When trying to connect to a DFS network folder, I encountered the following
: 1. manually, everything connects perfectly, it requires a user password, and the folder opens successfully under its rights.
2. when trying to automate this process, it became necessary to put the user's password in the script, and put the script in autoload. It turned out that it was necessary to enter the password in plaintext in the format password=12345 in the script.
Is there any possibility, instead of Password=, to register any other command that would work at least with the hash of this password?
To connect to the share, I used the following line:
sudo mount -t cifs //192.168.0.1/dfs -o username=admin password=12345 /media/dfs/
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Aleksandrov, 2019-08-06
@imurd

register mounting the balls through fstab, instead of login and password, specify the option credentials=/path/.smbcred
For the .smbcred file, limit the rights, write in it

username=admin 
password=12345

Depending on the options in fstab, you can specify automounting or without it. Manually, the user will be able to mount the share without sudo simply by writing
. In addition, mounting by applets will also become available again without superuser rights.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question