Cloud server interactive ssh to manage crons and server wide user and group administration for basic auth password protected directories
Considerations
- (!) This article is indended for a technical audience
- (!) This interactive ssh script is available for cloud server customers only. To request your key file, please contact support.
- Cronjobs can be managed via the control panel. See this article. If more control or precision is required, you can directly manage the cronjobs on the Linux system level.
- Password protected directories can be managed via the control panel. See this article. But there's no support for groups and every domain has their own list. If there are many users and groups that are shared between multiple accounts, it can be much easier to manage on a server level.
HOWTO Initial setup (Mac OS X)
Key file - The key file you receive from support needs to be stored in ~/.ssh
$ cd ~/Downloads $ cp file.key ~/.ssh/<myusername>
HOWTO Connect to server
Connect to the server using this special key file
$ ssh -i ~/.ssh/<myusername> <serverhostname>.managedomain.nl -p 1022 -l <myusername>
HOWTO Update cron file
1 for CRON 2 for HTACCESS 1 Enter username for crontab edit: abcd1234 efgh5678 abcd1234
Now the crontab file for this user opens with nano and you can edit the file.
For example, you add a cron that runs every day at 1:00am and calls a specific URL
# m h dom mon dow command 0 1 * * * curl "https://example.com/path/to/cron"
To save, hit Ctrl-X and follow the steps.
HOWTO Add a new user to a new (or existing) group
Step 1 - create new user
1 for CRON 2 for HTACCESS 2 1 - GROUP EDIT 2 - ADD USER 3 - DELETE USER 2 Enter username to add user1 New password: *** Re-type new password: *** Adding password for user user1 All done!
Step 2 - Add the user to a group
Please make a choice 1 for CRON 2 for HTACCESS 2 1 - GROUP EDIT 2 - ADD USER 3 - DELETE USER 1
Now you're editing the group file with nano. Add the new user to one or more of the groups. Always separate users by a space and keep them all on the same line.
group-1: user1 user2 user3 group-2: user4 user5
If you wanted to add the user to a new group, you could do it in the same file, something like this.
Make sure you don't use special characters or spaces in the group name.
group-1: user2 user3 group-2: user4 user5 my-new-group: user1
You can add the user to one or more groups.
To save, hit Ctrl-X and follow the steps.
Step 3 - Verify
Check if your updates work by visiting the URL you're trying to protect in a new incognito window.
HOWTO Delete a user from a group
Step 1 - Update the group information
Please make a choice 1 for CRON 2 for HTACCESS 2 1 - GROUP EDIT 2 - ADD USER 3 - DELETE USER 1<br>
Now you're editing the group file with nano. Remove the user from one or more groups on the right side of the : colon. If you removed the last user from the group, you could consider removing the group by removing the whole line.
group-1: user2 user3 group-2: user4 user5
To save, hit Ctrl-X and follow the steps.
Step 2 - Delete the user (Optional)
Please make a choice 1 for CRON 2 for HTACCESS 2 1 - GROUP EDIT 2 - ADD USER 3 - DELETE USER 3
Enter the username to delete.
Step 3 - Verify
Check if your updates work by visiting the URL you're trying to protect in a new incognito window.
HOWTO Allow a group access to a directory
Visit this article (Advanced use > Many users) to add a group to your .htaccess file. This is typically done via SFTP or the file manager as this is where you are able to update the .htaccess file that protects the directory.
Example .htaccess file:
AuthType Basic AuthName "Authorized personnel only." AuthUserFile /home/user1234/.htpasswd AuthGroupFile /home/user1234/.htgroup Require group group-1 group-2