Sometimes, on old systems, we need to mount a samba-share.
Create a file: /etc/cifs.pwd with
~#touch /etc/cifs.pwd
~#chmod 600 /etc/cifs.pwd
And add in that file the login/password file. Content Format is very simple - as follow:
username=smbuser
password=smbpassword
Password/username is in cleartext !
After that - you can mount the share as root with:
~#mount -t smbfs -o credentials=/etc/cifs.pwd //REMHOSTIP/remotedir /localdir
In this example, /remotedir is the remote Directory/Share and /localdir is the local Directory you mount it in on your local file system. This localdir needs to exist on you local machine.
Example:
Assume the Samba Host is: 192.168.101.56
Remote Share is: /smbtmp
Local mount Directory is: /mnt/smbtmp
We would have:
~#mount -t smbfs -o credentials=/etc/cifs.pwd //192.168.101.56/smbtmp /smb/smbtmp
To make it easy - you add the data to the /etc/fstab file.
//192.168.101.56/smbtmp /mnt/smbtmp smbfs credentials=/etc/cifs.pwd
With this, a simple: "~#mount /mnt/smbtmp"
is be enough to mount the samba share.
|