Question : How to get vncserver to accept connections by configuring it via the command line ssh (Server is Red Hat)

I have a Red Hat Machine that I have access only via ssh.   I have vnc installed on it through an rpm.

the vncserver is running but I can't connect

this is over a lan, ... layer 2

Answer : How to get vncserver to accept connections by configuring it via the command line ssh (Server is Red Hat)

Are you able to connect to the VNC server as localhost first?  If so, then add a tunnel to your ssh using the -L parameter (see man page for complete details).  Something like:

ssh username@hostname -L 5501:hostname:hostsvncserverport

... the 5501 is your local port on your local machine.  Then fire up your vncviewer & use localhost:5501 to connect to - the ssh session is listening on that port by this point & tunnels the connection through the ssh to the destination vncserver.
Random Solutions  
 
programming4us programming4us