I want to use SSH Tunneling on my local machines to bypass government restrictions. I'm talking about creating a socks proxy server using a ssh connection.
ssh -f -N -D 1080 [email protected]
This works perfectly right now. But I want to pass this to few other people (friends and family members). The thing is right now I'm using an admin user to do this. I thought I should probably just create a non-admin/guest user for each person.
I'm a bit worried if they decide to ssh normally and mess up with the server, or if they lose the login credentials or it gets into a hacker's hand.
That's I wanna take it one step further and just limit them to the point where they literally can't do anything or harmful, but with just enough functionality to run the ssh tunneling.
So what do I do after adduser <username>
?
useradd -s /bin/false
but i do not know if this breaks your ability for tunnels.-s /bin/balse
to see if you are still able to use the tunnel without giving the user the ability to use a shell?ForceCommand echo 'This account is limited'
in thesshd_config
file and it prevents users from connecting to server while being able to do ssh tunneling. is that secure enough though? I tried toChrootDirectory /var/chroot/
but it breaks the ssh tunneling. And no I haven't tried-s /bin/balse
because I need the user to have a home directory so I can put their ssh keys in there (~/.ssh/authorized_keys
)