You only need a server at the remote end (where the output of the proxy will come from. The local proxy port is setup for the duration of the ssh command, when can be backgrounded.
Example: Run this...
ssh -N -o BatchMode=yes -D 4001 $rhost firstname.lastname@example.org &
echo PID of SSH proxy = $!
Now you have a SOCKS proxy port on 4001 of the local machine.
Remember that PID! You need to kill that background daemon process to close the proxy link!
Here is a test I like to try...
curl --socks5 localhost:4001 http://anonymouse.org/cgi-bin/anon-snoop.cgi |
grep -A1 IP
This should return the IP address of the remote host where the SOCK proxy comes out! If it comes back with your local IP, or an error something is wrong.
You may like to look at "tsocks" which is a LD_PRELOAD library that will force most applications to use the indicated proxy port for its internet communications.