0

Parrot is based on debian. All I do in Ubunto 18.04 lts and 20.04 lts works fine. In Parrot - not (at least not in my env). This is fresh installation, default, static IP, fully patched and after few reboots.

Windows is 8.1 pro in domain (2012R2 forest level), fully patched, no antivirus, firewall enables traffic. User is domain admin with no special chars in name and password, just to make it work.

So, to make it easier I do everything in command line as root (sudo -i).

nano /scripts/creds

username=user1
password=Password1
domain=test.local

The command:

mount -t cifs //192.168.1.10/d$ /mnt/disk_d -o credentials=/scripts/creds

In new Linux installations highest SBM version is taken by default, like other things (yey), so forcing these don`t change much (it works).

It works from command line (sudo). No errors and there are windows files and folders in /mnt/disk_d

It works from bash file: "./mount_windows.sh" with this line inside.

It doesn`t work in /etc/fstab. Command

mount -a -v

generates "parse error at line 19 -- ignored", this line is for mount. Physical disks are "already mounted".

So I tried to add one or more of them:

"file_mode=0777,dir_mode=0777", "serverino" or "noserverino", "sec=ntlmv2", "perm", "auto", "vers=3.0", " 0 0"

or just mix everything with different position with no success. Please remember it works from command line with no additional options.

It doesn`t work from /etc/crontab.

mount.cifs sits in /sbin so everything is ok.

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

added:

* * * * * root mount -t cifs //192.168.1.10/d$ /mnt/disk_d -o credentials=/scripts/creds
53 * * * * * root mount -t cifs //192.168.1.10/d$ /mnt/disk_d -o credentials=/scripts/creds
@reboot mount -t cifs //192.168.1.10/d$ /mnt/disk_d -o credentials=/scripts/creds
@reboot root mount -t cifs //192.168.1.10/d$ /mnt/disk_d -o credentials=/scripts/creds
@reboot sudo bash -x /scripts/mount_windows.sh

Restart cron shows no errors:

"systemctl restart cron" 

None of these mounted disk after a full reboot.

So I added

echo "1" >> /scripts/log.txt

to check if anything is proccessed. File is created and "1" is added.

After each reboot there is nothing in /var/log/messages.

I don`t know why is this so hard to make it work. It works from command line and from sh.

  • The `/etc/fstab` is the right way to go for getting it to mount - you don't mention what the fstab line looks like, though. The rest of this might be issues with cron jobs with the @reboot option not working - it evidently only works for root, and may depend on the version of cron installed. – Anya Shenanigans Mar 23 '21 at 15:52
  • /etc/fstab line looks the same as .sh or plain cmd: "mount -t cifs //192.168.1.10/d$ /mnt/disk_d -o credentials=/scripts/creds" – dobrakawusia Mar 23 '21 at 18:31
  • No one have knowledge how to mount a Windows share on ubuntu clone? In 2021 year? "So much" admins/devops here, LOL.... – dobrakawusia Mar 27 '21 at 22:32
  • The problem is that an `/etc/fstab` line looks very different from a mount command, so the error indicates that it’s wrong, which is why I was asking to see it. If you follow the format of an fstab entry, then you should get it working. This is not a programming issue, this is more akin to a superuser.com issue. – Anya Shenanigans Mar 29 '21 at 12:43

0 Answers0