SSH

tunnel ports settings in Windows 7

if you try to setup tunneling in the ssh clients mostly the client will crash. the easy way is to find the config file for ssh client in the folder

C:\Users\kamarj\AppData\Roaming\SSH

each profile will be stored as default.ssh2 or jc.ssh2 (the two profiles that i have now).
Open the file in a text editor and type the following for tunneling vnc through ssh2

[Outgoing Tunnels]
Tunnel=S:vnc,5901,localhost,5901,1,tcp
Tunnel=S:vnc2,5902,localhost,5902,1,tcp

save the file and restart the client. you will see the tunneling options appear in the corresponding tab.

tunnel ports

ssh -N -l someuser -L 143:localhost:143 -L 25:localhost:25 jaya.homelinux.org

Forward X11

if you want to forward X through ssh we call as follows
ssh -X jc@servername
if you find that you cannot open any X clients and we get the following error message
xterm Xt error: Can’t open display:
xterm: DISPLAY is not set
then you can find out what is happening by using the following
ssh -X -v jc@servername
which will give verbose information such as
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Remote: No xauth program; cannot forward with spoofing.
then xauth was not installed.
this xauth is part of the package xbase-clients.

SSH login Banner

I always that it is cool to get the banner that gives some security warning before you login to the server. My school systems had it and never bothered to install it in mine.
Open /etc/ssh/sshd_config
uncomment or add this line

Banner /etc/issue.net

Edit the file issue.net with the contents that you want to display. now you got a dialog box with the message. The other type of message is motd or “Message of the day”. just edit the file /etc/motd and that will be printed everytime you login.
———–18-August-2006.

SSH Server Configuration

I had some problem with the debian SSH server for some time. It is not that i can’t use it at all. The problem is with the authentication. It is something like challenge/response authentication which i never liked. I wanted to change it to normal Password authentication and no luck. Finally I got it from someplace here. All i had to was to configure the server to accept Password Authentication instead of the default Public Key Authentication.
Open the /etc/ssh/sshd_config file
Locate the line below in config file

   PasswordAuthentication yes
   ChallengeResponseAuthentication no
   PubKeyAuthentication no

and disable the above option by place a # in front of it.
——————06/28/04

X11 over SSH for Root

May be I’m not lucky anymore. usually whenever i have trouble, i google it and within two or three tries, i get the answer, because i had the correct keywords. This is the problem I had
I ssh to my debian machine from my work laptop(windows 2000, cygwin X Server), forward X11 and run X application. Suddenly one fine day I cannot run application esp “make xconfig” as a super user.
I got different error messages

X11 server shutdown 
X11 server reset

my google result didn’t get me any answer, because my keywords were not good enough. But i got the perfect keyword, which was

X11 connection rejected because of wrong authentication

with this keyword i got the most appropriate result for my quest. from google group or usenet.
The answer is simple
The default location of the Xauthority file is changed. And when you ssh, normally export XAUTHORITY=/tmp/whatever was done, now it doesn’t work that way anymore. So now once you su(again you don’t want to ssh to your machine as root, that will open a huge can of worms), all you have to do is let the system know about the .Xauthority file as follow

export XAUTHORITY=/home/jc/.Xauthority

or copy this into the roots home directory.
Now when i play with xserver sometimes some of the packages get lost, and then when i try to forward X through ssh, i get the following warning

(application:number):Gtk-WARNING ** : error cannot open display:

SSH disconnect

This might help. open sshd config
ClientAliveInterval 45 ClientAliveCountMax 50

Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *