SSH strangeness


 
Thread Tools Search this Thread
Operating Systems Solaris SSH strangeness
# 1  
Old 12-12-2014
SSH strangeness

Two SPARC servers running latest patches on S10U11. When the mysql account logs into either machine from a windows 7 workstation via putty or other ssh program, the first attempt works fine. Trying to ssh in from the same terminal a second time using either the mysql account or any other LDAP account yields an immediate Connection Refused response. This refusal will continue for several minutes. Logging off the first mysql session does not allow another login from any account until whatever is happening times out. Logging into multiple sessions with other accounts from the same workstation works fine; this appears to be tied to the mysql account.

While attempted logins are getting the Connection Refused message while trying to connect from the windows workstation, sshing to the machines from any other Solaris/Linux box (even using the mysql account) works fine.

Any wild ideas?
# 2  
Old 12-13-2014
try
Code:
ssh -v

and show us the outputs? It might contain some info.
# 3  
Old 12-15-2014
Well, here's the interesting thing. I use putty and turn on logging and the log is empty. So I use the SSH that comes with Cygwin and -vvv tells me that it checks the stuff in ~/.ssh, enables compatibility mode for protocol 2.0 and then "ssh_exchange_identification: Connection closed by remote host." Period. End of communication.

This is another explanation. SSH to Solaris 10 (u11) box as LDAP user mysql from windows workstation. Login successful. Try to log in to the same Solaris box as any other user. Fails with unexpected disconnect mesage. In the meantime, you CAN ssh into the box from another Solaris 10 machine as any account, including mysql. This only seems to happen when you log in as mysql.

It is as if the Solaris machine allows mysql to have only one session per ip per x number of minutes.

---------- Post updated at 11:57 AM ---------- Previous update was at 08:52 AM ----------

Another update. When "mysql" user logs in, an entry is made automatically in /etc/hosts.deny: ALL:ip.add.rr.ess where ip.add.rr.ess is the my workstation ip.

I do not know what is causing this entry; it does not do it for any other account. TCP_wrappers does not appear to be running; I don't see anything in cron to indicate there is some other script running that could be checking the ssh logs, etc. Removing hosts.deny from /etc seems to alleviate the issue for now.
# 4  
Old 12-15-2014
That explains it.
But what puts the entry there?
What gives
Code:
ls -l /etc/hosts.deny

Is it owned by root, not writable by others?
Any correlation with the login time?
Any correlation with a root crontab entry?
# 5  
Old 12-15-2014
There's nothing in root's (or anyone else's) crontabs that would do this.

Only root has write access to hosts.deny. The OSSEC group has read access.

Before lunch, I renamed hosts.deny to hosts.deny.org. When I came back from lunch, it recreated hosts.deny. Sure enough, I logged in as mysql and the ip deny line is added into hosts.deny.

Some people read Ellery Queen or Sir Arthur Conan Doyle. They should just follow me around because I'm always finding stuff like this.
# 6  
Old 12-17-2014
OSSEC.

Ossec has a feature that will create the hosts.deny file and populate it with "bad" ips.
This User Gave Thanks to cjhilinski For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find active SSH servers w/ ssh keys on LAN

Hi, I am trying to complete my bash script in order to find which SSH servers on LAN are still active with the ssh keys, but i am frozen at this step: #!/bin/bash # LAN SSH KEYS DISCOVERY SCRIPT </etc/passwd \ grep /bin/bash | cut -d: -f6 | sudo xargs -i -- sh -c ' && cat... (11 Replies)
Discussion started by: syrius
11 Replies

2. UNIX for Beginners Questions & Answers

Ssh script to validate ssh connection to multiple serves with status

Hi, I want to validate ssh connection one after one for multiple servers..... password less keys already setup but now i want to validate if ssh is working fine or not... I have .sh script like below and i have servers.txt contains all the list of servers #/bin/bash for host in $(cat... (3 Replies)
Discussion started by: sreeram4
3 Replies

3. Shell Programming and Scripting

Check if file exists via ssh in ssh (nested)

I'm using redhat and have an odd issue with a nested ssh call. ssh -i ~/.ssh/transfer-key -q transfer@fserver1 ] && ssh -i ~/.ssh/transfer-key transfer@fserver1 "ssh -i ~/.ssh/sftp-key sftpin@10.0.0.1 ]" && ssh -i ~/.ssh/transfer-key transfer@fserver1 "scp -i ~/.ssh/sftp-key /home/S/outbox/*... (2 Replies)
Discussion started by: say170
2 Replies

4. Shell Programming and Scripting

Ssh = ssh expect and keep everything not change include parameter postion

I have write a script which contains ssh -p 12345 dcplatform@10.125.42.50 ssh 127.0.0.1 -p 5555 "$CMD" ssh root@$GUEST_IP "$CMD" before I use public key, it works well, now I want to change to "expect", BUT I don't want to change above code and "parameter position" I can post a... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

5. Shell Programming and Scripting

could not send commands SSH session with Net::SSH::Expect

I am using Net::SSH::Expect to connect to the device(iLO) with SSH. After the $ssh->login() I'm able to view the prompt, but not able to send any coommands. With the putty I can connect to the device and execute the commands without any issues. Here is the sample script my $ssh =... (0 Replies)
Discussion started by: hansini
0 Replies

6. Solaris

Cron strangeness

Good Morning Fellow Admins! I have a v880 running Sol9. The cron daemon is executing a crontab for a user and the user is in /etc/cron.d/cron.deny. /etc/cron.d/cron.allow exists and the user is not in it. What am I missing? Thanks in Advance! Tony (3 Replies)
Discussion started by: bluescreen
3 Replies

7. UNIX for Advanced & Expert Users

Expect Script Strangeness

Hi all, I am trying to use a very simple expect script to automate entering one or two details into a console connection of a solaris machine so that I can do a boot net - install. If I run the console connection script manually myself, it connects fine and when I hit enter, I am on the... (2 Replies)
Discussion started by: mark007
2 Replies

8. IP Networking

IP# Strangeness Please Help

Hi I've stumbled over something that caught my attention but I'm not familiar enough with IPs to know if this is suspect or irrelevant. If you'd take the time to read and respond I'd greatly appreciate it. I'm just stumped. I've done a site for some people (4 in the group) awhile ago and set... (4 Replies)
Discussion started by: jolene
4 Replies
Login or Register to Ask a Question