restricting ssh login based on IP

Tapas Mishra mightydreams at
Sat Feb 26 05:32:28 UTC 2011


I would like to allow a user to login through SSH but with different
permission coming from different ipaddress.

For example, a user "tester" login to SSH through and
another user login with the same login id "tester" but from different

How do I restrict to only allow for viewing the content in
the home directory while giving full access?

I got a suggestion from some one

Approach 1)
 Based on the ip you change the shell. If it's just for read only a
jail would be fine.

but how do I change shell based on IP?

Approach 2)

 to have two ssh instances. Let's say port 22 and port 24. Port 22 is
for read only, while port 24 is for full access

so how can it be possible to give port 22 only read only access to SSH


More information about the ubuntu-server mailing list