I am currently using SFTP on my MacBook to perform file transfers with my brother's Linux (Ubuntu) system. Every time we need to share a file, I start the FTP server on my Mac by running the following command on Terminal:
/Users/Amit/Documents/Scriptlets/ftps.sh open
The content of this script is as follows:
#!/bin/sh
if [ $1 = 'open' ]; then
sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
echo SFTP opened
fi
if [ $1 = 'close' ]; then
sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist
echo SFTP closed
fi
if [ $1 = 'check' ]; then
ftp localhost
echo check
fi
Once done, I give my local IP address, user name, and password to my brother who is already connected to my Mac over wifi and he uses that information to establish an FTP connection with me and share files.
The problem with this process is that I need to open Terminal every time I want to run this command and I need to enter my password there. Is there any way to automate this so that I just click an automator menu item on any of my Finder windows and feed it the password programmatically without manually opening up the Terminal program? Also, is there any way to ensure that my brother (or anyone I am providing my username and password) is able to access only a designated folder (preferably, Public folder) during the FTP session and nothing else?
Here's what I'd prefer to do every time I need to perform a file share with someone: I'd like to be able to just click on an (Automator) icon on my finder menubar to activate FTP on my system. Upon clicking, the Automator action should just open up FTP server on my laptop (the password being fed to it through the code itself) and throw a popup confirming the connection as active with the IP address that I need to relay to my brother so he could attempt to connect. Once the file transfer is done, I would like to just click on the same icon again and get a popup confirming that FTP has been closed. Is it too complicated a process?