Unusual SSH behavior

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read this

Unusual SSH behavior

Postby skitsykitsy on Tue Oct 30, 2012 10:02 pm

Hi folks. Your friendly neighborhood Linuxnoob here. Don't laugh at me.

I recently started messing around with SSH, which is really a topic I don't know much about. I thought I'd never need to use it, but now I'm starting to see its usefulness even in a home network.
I've got it working quite well on my home network, and I'll likely use it to make a secure media/file server, but one issue in particular that's cropped up during this has me a little concerned.

I only want to be able to log into one account remotely. My laptop has my main account and one I named "sshs" (SSH server) for test purposes. This is probably going to be a similar setup when I do commit to setting up an actual server - I'll have an admin account with full sudoers permissions, etc, and one that's available for SSHing in and grabbing files from its home directory.

I set "AllowUsers" and "DenyUsers" to allow the sshs account and deny the main account respectively on the server, and this works perfectly when SSHing in through a terminal. It denies access when I try to log in from the netbook as the main account.
But if I go "Connect to server" on my (Ubuntu, btw) netbook, in the filemanager, set my username and password as the already denied main account, and hit enter? Bang, I'm in on my main account.

Even more worrying, I can see the terminal session on the host machine's process list and user list (the "w" command displays their shell session) but again only if the remote computer has logged in through a terminal. Connecting through the "Connect to server" option effectively makes the remote user invisible and I can't kick them. Definitely do not want.

Finally, I was a smartypants and made a few scripts for shutting down, restarting, reporting the status of the SSH daemon on the server. But when someone is connected through the file manager as above, I can kill the SSH service (su -/sudo service ssh stop) and yet the remote computer can still navigate the server, and create, delete, modify files! This is after I have stopped the ssh service ("service ssh status" indicates it's definitely stopped). So I can't even do THAT. Nothing aside from disconnecting entirely from the network stops someone connecting in this manner. Heck, I even tried to slam the firewall down, but if they're already connected it doesn't seem to matter.

Anyone have a clue what's going on here? Is there a different configuration for ssh terminal connections and "sftp" connections using a file manager or browser?

- Someone connecting remotely with SSH using the file manager's SFTP "Connect to server" option can log in as any account apart from root
- They're invisible to the host machine
- Almost nothing can kick them or rescind access.
Pretty big security holes, heeeelp!

Also, while I appreciate any advice like "Don't use SSH for this, use _____!", I also need to get this sorted out. Never know when I might need to know what's going on in the future. I know I can limit connections to certain IPs using firewalls, the hosts.allow/deny files, but even still this behavior strikes me as something to fix.

Oh, and yep, I'm probably gonna use Linux Mint for the server - not run it as something like a headless FreeBSD or a Windows Server. Hey, what if I want to log onto it, into something awesome like MATE or Cinnamon, and do something? :D
skitsykitsy
Level 1
Level 1
 
Posts: 4
Joined: Sun Oct 28, 2012 1:15 am

Linux Mint is funded by ads and donations.
 

Re: Unusual SSH behavior

Postby skitsykitsy on Fri Nov 02, 2012 1:52 am

Nobody? :(

I can close SSH sessions initiated through the terminal easily, but not if they use the "Connect to Server" option in Nautilus/Caja. Anyone able to clue me in?
skitsykitsy
Level 1
Level 1
 
Posts: 4
Joined: Sun Oct 28, 2012 1:15 am

Re: Unusual SSH behavior

Postby kwisher on Mon Nov 26, 2012 3:47 pm

skitsykitsy wrote:Nobody? :(

I can close SSH sessions initiated through the terminal easily, but not if they use the "Connect to Server" option in Nautilus/Caja. Anyone able to clue me in?


When you are "browsing" from the file manager, I don't believe you are using the SSH protocol. Someone please correct me if I am wrong.
The instructions suggested Windows XP or better, so I installed Linux :)
User avatar
kwisher
Level 5
Level 5
 
Posts: 635
Joined: Wed Mar 05, 2008 12:54 pm
Location: Greentown, Indiana USA


Return to Other networking topics

Who is online

Users browsing this forum: No registered users and 1 guest