[TentacleWiki] [TitleIndex] [WordIndex


"Here's one way. I'll ssh from mercury to ceres so that ceres can ssh back to mercury.

First ssh from mercury to ceres:

The "-R 5555:127.0.0.1:22" switch means, "on the remote end (ceres), please make port 5555 connect to 127.0.0.1 (mercury), port 22 (ssh)."

Now, on ceres:

This says to ssh to port 5555 on ceres, which is really the ssh tunnel established by the ssh we did into ceres from mercury.

SSH tunneling is a many-splendered thing."



An alias for an encrypted directory

alias encrypt "cd ~/private ; zip private * ; pgp -c private.zip ; cp private.zip.pgp .. ; rm * ; cp ~/private.zip.pgp . ; cd .. ; rm private.zip.pgp"

alias decrypt "cd ~/private ; pgp private.zip.pgp ; unzip private.zip ;cp private.zip.pgp ~/.private.zip.pgp ; rm private.zip ; rm -i private.zip.pgp ; cd ~"

Make a directory called private in your home directory (ei. "cd ~ ; mkdir private"). Add the above two aliases to your .cshrc file or your .login file and then "source .cshrc" or "source .login". Your .cshrc file is in your home directory as is the .login file. Also make sure each alias is on its own line with no return carriages anywhere in that long line.



How to set up password protected web directories

Log into tentacle via ssh.

Type in "htpasswd -c .htpasswd usernameofchoice" where usernameofchoice is the user name you'd like to have when you log into your private section of your website.

Then "cd public_html" and "mkdir private" or mkdir whatever you wish your private directory to be called, its url will be http://www.tentacle.net/~yourusername/private in this senario, you can of course put it anywhere you wish.

Then "cd private" and "pico .htaccess"

Add the lines:

<nop>AuthName</nop> private

<nop>AuthUserFile</nop> /u0/yourusername/.htpasswd

<nop>AuthType</nop> Basic

<Limit GET POST>

require valid-user

</Limit>

And then exit and save the file. The <nop>AuthName</nop> part is what appears in the dialog box asking you for your login and password when you go to the protected part of your website. The <nop>AuthUserFile</nop> is just the location of the .htpasswd file on tentacle.net, you can always type "pwd" when you are in the directory with the .htpasswd file in it to make sure you've gotten this part right. You'll need to do an "ls -a" to see the .files in the directory you are in.

Of course files in your private directory still need to be world readable to be seen over the web, which means all tentacle.net users can also just cd into your private directory and read your files, but hey, I thought it was nifty, and so might you.



2020-10-05 00:39