SSH/rdesktop - cannot configure SSHD server
My Ubuntu won't allow SSH connections to the SSH serveron my BT5R2. Putty closes the connections and displays a "Connection reset by peer" err msg. Nmap 192.168.x.x shows that SSHD is active and running on the remote machine, port 22. The cmdline of SSH version doesn't work either.
The instructions I followed are confusing! Can somone explain how to set up a secure SSHD daemon on BT5R2, step by step. The guides recommend using puttygen for the pub key and then saving it to a file, some recommend using openssh. I can't figure the conf file and pub/private keys. I got vsftp up and running on port 21. Now I want to use rdesktop through a ssh tunnel. |
Hi,
you should check the logs on the machine running sshd. Start with looking at /var/log/auth.log. If you don't find the information you need there, then try running an instance of sshd in dbug mode which will output even more information. You may also make more progress using "ssh -vvv localhost" to debug the problem. Evo2. PS. When using obscure acronyms (version numbers?) like "BT5R2" it's best to define them. |
@evo2 Now I'm even more perplexed! The authlog file shows....
Mar 23 09:39:01 bt CRON[2162]: pam_unix(cron:session): session closed for user root Mar 23 10:09:01 bt CRON[2395]: pam_unix(cron:account): account root has password changed in future Mar 23 10:09:01 bt CRON[2395]: pam_unix(cron:session): session opened for user root by (uid=0) Mar 23 10:09:01 bt CRON[2395]: pam_unix(cron:session): session closed for user root Mar 23 10:17:01 bt CRON[2437]: pam_unix(cron:account): account root has password changed in future Mar 23 10:17:01 bt CRON[2437]: pam_unix(cron:session): session opened for user root by (uid=0) Mar 23 10:17:01 bt CRON[2437]: pam_unix(cron:session): session closed for user root Mar 23 10:39:02 bt CRON[2519]: pam_unix(cron:account): account root has password changed in future Mar 23 10:39:02 bt CRON[2519]: pam_unix(cron:session): session opened for user root by (uid=0) Mar 23 10:39:02 bt CRON[2519]: pam_unix(cron:session): session closed for user root when I used the -vvv switch on the client end, I got the following: joe@name-comp-000:~$ ssh -vvv sshuser@192.168.1.27 OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to 192.168.1.27 [192.168.1.27] port 22. debug1: connect to address 192.168.1.27 port 22: Connection refused ssh: connect to host 192.168.1.27 port 22: Connection refused sshuser exists on the server, the machine running sshd. So, all this leads me to believe that its either a problem with the way its configured or a pub/pri key issue. Anyone know of an easy to follow guide? I don't have access to the GUI version puttygen, btw. |
Hi,
you need to look at the lines in auth.log with timestamps that correspond to when you are trying to ssh to that machine. That doesn't seem to be the case with what you have posted. You could do the following: open open to terminals on 192.168.1.27. In the first terminal, run Code:
tail -f /var/log/auth.log Then in the second terminal run: Code:
ssh -vvv sshuser@localhost Evo2. |
@evo2 It appears that the output on the window load with the tail cmd is the same on BT5R3 (BackTrack5r3). I tried executing the ssh -vvv cmd in a seperate terminal to see if the first window would dynamically update. Every time I invoke the ssh cmd it get a "Connection refused" err msg.
Heres the ouput: First terminal (load with tail -f) Code:
root@bt:~# tail -f /var/log/auth.log Code:
root@bt:~# ssh -vvv sshuser@localhost |
Hi,
are you really sure that sshd is running? You should be able to see the process with: Code:
ps aux|grep sshd Code:
netstat -an | grep LISTEN | grep tcp | grep 22 |
@evo2 I re-installed ssh and now its like I cannot connect as root or sshuser. Heres what it the logs look like.
First terminal: Code:
root@bt:~# tail -f /var/log/auth.log Code:
root@bt:~# ssh -vvv sshuser@localhost |
Hi,
I still don't see anything from sshd in auth.log. Please confirm it is really running as per post #6. Evo2. |
Evo2 yes, its running on port 22. I ran nmap localhost. Post #7 shows the output of ssh -vvv after I re-installed. I cannot login in using the root acnt or sshuser the I created. I'm starting to think I'm better off ditching BT5R3. any suggestions?
|
Hi,
ok it's strange that we don't see anything from sshd in auth.log (it is also strange to see those messages about the root password being changed in the future, I guess your clock was wrong at some point). If you want to continue to work on this I'd suggest running ssd in debug mode on a higher port and then trying to ssh to it. So, in one terminal: Code:
/usr/sbin/sshd -p 6666 -d Code:
ssh -p 6666 -vvv localhost I've never head of BT5R3 (best I've been able to work out from what you've posted is that it appears to be derived from Debian). Best distro depends on what you want to do with it. Debian itself is quite flexible and is often a good choice... other distros are available... Evo2. |
@Evo2 This is what we call a brain fart in the USA. I can't figure it out! I tried executing the cmds using the port settings and debug methods you suggested. Take a look at the output
Frist Terminal (sshd -p 6666) Code:
root@bt:/usr/sbin# sshd -p 6666 -d Code:
root@bt:~# ssh -p 6666 -vvv localhost Yes, the clock on my BT5R3 (BackTrack5r3) is wrong. It's actually a test machine on my network. BackTrack5 is a debian based distro, which is now known as Kali Linux. I have decided to set up a SSHD server on a Windows box to see if I get the same results when connecting to it from my Ubuntu. Any other suggestions? Do you know of any utilities such as sshd? I want to ultimately connect rdesktop through a ssh tunnel....its a lot more complicated that I thought. |
@Evo2 I got SSHD working on WinXP. So, now I know its some kind of config issue. BT5R3 isn't accepting the connection...I bet its a simple fix. Unfortunately, the BT5 forum is closed! :( Lets see what google has to say...thanks for trying!
|
Hi,
the output from sshd indicates that there are no host key files. I think reconfiguring the package should generate them. eg Code:
dpkg-reconfigure openssh-server |
evo2 I knew all along it was trivial. Thats exactly what I had suspected since I never generated keys in the first place. I also noticed that the Win version of Freesshd requires users to generate a "RSA" key. Now it actually works! Thanks to your suggestion. You're awesome Evo2! You're a good friend! Now all I have to do is figure how to tunnel rdesktop through the tunnel...stay tuned....
|
OK. Everything is in order. Now its time for us to clarify. Evo2, can you please explain the significance of generating keys using openssh's cipher?
|
All times are GMT -5. The time now is 10:56 PM. |