Accessing VPS via SSH on Port 21



  • I changed my SSH port on my VPS from 22 to 21 so I could mess around with my VPS while I'm at work.  They started locking down a lot of our ports.  I'm not sure if this is going to work, but it was worth a shot.  Now I can't login.
    I'm getting a "Server unexpectedly closed connection" error.

    I noticed a bunch of pftpx logs in my pfsense appliance at home so I passed destination port 21 through as a firewall rule and now I'm not seeing them.  I still feel like pfsense is messing with something as I try to connect with my VPS.

    If I connect with putty RAW to my VPS IP at port 21 I get: "SSH-2.0-OpenSSH_5.1p1 Debian-5" and the SSH process is definitely running according to the web control panel.  Is there a chance pfsense is doing this?  I turned off Avast to make sure that wasn't doing it here.

    My Debian VPS is telling me :
    May 13 02:54:41 vpshostname sshd[18285]: Accepted password for root from MY.IP.ADDRESS port 50726 ssh2
    May 13 02:54:41 vpshostname sshd[18285]: pam_env(sshd:setcred): Unable to open env file: /etc/default/locale: No such file or directory
    May 13 02:54:41 vpshostname sshd[18285]: pam_unix(sshd:session): session opened for user root by (uid=0)
    May 13 02:54:42 vpshostname sshd[19473]: pam_env(sshd:setcred): Unable to open env file: /etc/default/locale: No such file or directory
    May 13 02:57:19 vpshostname sshd[1760]: Received SIGHUP; restarting.
    May 13 02:57:19 vpshostname sshd[23602]: error writing /proc/self/oom_adj: Operation not permitted
    May 13 02:57:19 vpshostname sshd[23602]: Server listening on :: port 21.
    May 13 02:57:19 vpshostname sshd[23602]: Server listening on 0.0.0.0 port 21.
    May 13 02:58:46 vpshostname sshd[18285]: pam_env(sshd:setcred): Unable to open env file: /etc/default/locale: No such file or directory
    May 13 02:58:46 vpshostname sshd[18285]: pam_unix(sshd:session): session closed for user root
    May 13 02:59:23 vpshostname sshd[24498]: error writing /proc/self/oom_adj: Operation not permitted
    May 13 02:59:23 vpshostname sshd[24498]: Did not receive identification string from MY.IP.ADDRESS

    I restarted everything around 2:57.  the error writing thing appears in the logs everywhere, doesn't seem to be an issue.  The "Did not receive identification string" thing seems to be more of the issue.



  • Just wanted to let people know I fixed this.  I had to turn FTP Helper on (uncheck) on both LAN and WAN interfaces and then I had to recheck it to off (checked) on both interfaces and save it.  I think I must have done something to them when I was playing around trying to get it to work the first time.  Having it disabled on both LAN and WAN interfaces seems to work.

    Oddly enough there were no logs regarding it blocking this so I had no idea what the heck was going on.  It's working now.  I just wanted to update this in case anyone runs across the same issue.


Locked