I think I can get you started, but using terminal commands, which you said you'd prefer to avoid. Apologies, but it might give you a starting point. All of the following you could put in a bash script and run as a login item.
You'll need to first share out the target drive(s) (MyBook
in the examples below) using file sharing (System Preferences > Sharing > check the File Sharing box, add the drives you need and set appropriate permissions - I just use Everyone to keep it simple).
You can mount a remote machine and/or its associated drives using mount like so:
Make a directory as the mount point (obviously call test
whatever you want):
mkdir /Volumes/test
Now mount the remote drive. I'm assuming this is already connected to your iMac and appears when you connect to your iMac using Finder:
mount -t afp afp://<your mac's name>/<drive name to mount> /Volumes/test
On my remote Mac Mini, to connect to my MyBook attached to it via USB, that would be:
mount -t afp afp://bobs-mac-mini/MyBook /Volumes/test
If you need to authenticate (I got error -5000
when trying to mount my home folder), you can also do this using
mount -t afp afp://<username>:<password>@<your mac's name>/<drive name to mount> /Volumes/test
However, the password would unfortunately have to be in the clear. So again, this might be:
mount -t afp afp://binarybob:password123@bobs-mac-mini/MyBook /Volumes/test
You can also connect to your home folder using the above method, just by replacing MyBook
with the name of your home folder.
The drive you mounted should now appear in the finder and you should be able to use it like any other locally mounted drive. When you're finished, you can do:
umount /Volumes/test
to remove it. BTW, if you're not an administrator, you might need to add sudo
in front of each command and type an administrator password.
Best Answer
It turns out that you can use a Terminal command to achieve this. Note that parts of this command are deprecated, but I tested it on macOS 10.13.3 and everything seems to work.
pwpolicy -u testuser -setpolicy "maxFailedLoginAttempts=1"
. Assume thattestuser
is the short name of the user you want to apply the lockout settings to, and1
is the number of failed attempts required to trigger the account lock.If an account is locked, you can log into the administrator account again and unlock the standard account using the following command;
pwpolicy -u testuser -enableuser
.Update: I was able to test this with remote connections, and your device will not allow remote authentication with a locked account.