Hey Guys,
Big fan.., love your work
Background:
For VNC over ssh tunnel . I started allowing port 22 through my router to my home FC11 machine so I could vnc from work. I started noticing that people were probing for brute force access to ssh while looking through /var/log/secure. So i thought - why not setup a separate sshd daemon at a high number port, and only forward outside traffic to that higher port sshd for which I would make a stricter sshd_config file. I turned off forwarding of 22, and made a rule for 44112. I found this article at fixunix.com to setup dual sshd and did the following.
http://fixunix.com/ssh/364505-runnin...ne-server.html
Code:
cp -p /etc/ssh/ssh_config /etc/ssh/external_ssh_config
cp-p /etc/ssh/sshd_config /etc/ssh/external_sshd_config
then modified for different port and more strict logins.
cp - p /etc/rc.d/init.d/sshd /etc/rc.d/init.d/external_sshd
then modified for all pointers to point to "external_sshd" - even pid file.
ln -s /usr/sbin/sshd /usr/sbin/external_sshd
ln -s /etc/pam.d/sshd /etc/pam.d/external_sshd
add "OPTIONS -f /etc/sshd/external_sshd_config" to /etc/sysconfig/external_sshd
chkconfig --add external_sshd
service external_sshd start
doing a
shows:
Code:
1827 ? 00:00:01 sshd
23534 ? 00:00:00 external_sshd
However, when I try to connect to ssh from another(internal or external) computer just to test - as soon as I type in the password - it says "connection closed"
doing
Quote:
|
tail -n 25 /var/log/secure
|
shows:
Code:
Feb 4 11:39:59 orion external_sshd[23536]: Accepted password for mevel from 192.168.1.3 port 64907 ssh2
Feb 4 11:39:59 orion external_sshd[23536]: pam_selinux(external_sshd:session): conversation failed
Feb 4 11:39:59 orion external_sshd[23536]: pam_selinux(external_sshd:session): No response to query: Would you like to enter a security context? [N]
Feb 4 11:39:59 orion external_sshd[23536]: pam_selinux(external_sshd:session): Unable to get valid context for devel
Feb 4 11:39:59 orion external_sshd[23536]: pam_unix(external_sshd:session): session opened for user devel by (uid=0)
Feb 4 11:39:59 orion external_sshd[23536]: error: PAM: pam_open_session(): Authentication failure
Feb 4 11:39:59 orion external_sshd[23536]: error: ssh_selinux_setup_pty: security_compute_relabel: Invalid argument
Feb 4 11:41:58 orion userhelper[23545]: pam_timestamp(system-config-selinux:session): updated timestamp file `/var/run/sudo/root/4'
Feb 4 11:41:58 orion userhelper[23548]: running '/usr/share/system-config-selinux/system-config-selinux.py ' with root privileges on behalf of 'root'
Feb 4 11:51:41 orion external_sshd[23570]: Accepted password for mevel from 192.168.1.3 port 64911 ssh2
Feb 4 11:51:41 orion external_sshd[23570]: pam_selinux(external_sshd:session): Open Session
Feb 4 11:51:41 orion external_sshd[23570]: pam_selinux(external_sshd:session): conversation failed
Feb 4 11:51:41 orion external_sshd[23570]: pam_selinux(external_sshd:session): No response to query: Would you like to enter a security context? [N]
Feb 4 11:51:41 orion external_sshd[23570]: pam_selinux(external_sshd:session): Unable to get valid context for devel
Feb 4 11:51:41 orion external_sshd[23570]: pam_unix(external_sshd:session): session opened for user devel by (uid=0)
Feb 4 11:51:41 orion external_sshd[23570]: error: PAM: pam_open_session(): Authentication failure
Feb 4 11:51:41 orion external_sshd[23570]: error: ssh_selinux_setup_pty: security_compute_relabel: Invalid argument
It looks like pam_selinux yakks about the security context thing.
I don't understand though what the significance of security context is - or how to go about resolving this type of problem, so I thought I'd ask for help from the friendlies. Keep in mind that ssh-ing to the normal daemon on port 22 still works fine.
Am I going about this the wrong way? Is there a better solution to this situation?
Thanks in advance