Like Michael said I would accomplish this with two users.  Just off the top of my head I would do:<br><br>user 1) has full read/write access to /home/user1<br>user 2) has read only access to /home/user2<br><br>schedule cron to rsync from /home/user1 to /home/user2 and make everything read only for the /home/user2.<br>
<br>Dan<br><br><div class="gmail_quote">On Sat, Feb 26, 2011 at 2:04 AM, Michael Zoet <span dir="ltr"><<a href="mailto:Michael.Zoet@zoet.de">Michael.Zoet@zoet.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
Am <a href="tel:26.02.2011%2006">26.02.2011 06</a>:32, schrieb Tapas Mishra:<br>
> Hi,<br>
<br>
Hi Tapas,<br>
<div class="im"><br>
><br>
> I would like to allow a user to login through SSH but with different<br>
> permission coming from different ipaddress.<br>
><br>
> For example, a user "tester" login to SSH through 192.168.1.1 and<br>
> another user login with the same login id "tester" but from different<br>
> ip 192.168.1.2.<br>
><br>
> How do I restrict 192.168.1.2 to only allow for viewing the content in<br>
> the home directory while giving 192.168.1.1 full access?<br>
<br>
</div>Why do you have to use the same user? Viewing the contents of a<br>
directory has nothing to do with SSH and you need to use some other<br>
methods. So using different users to login would be the easiest to<br>
accomplish this. Then you need only to change the permissions on the<br>
filesystem. And if you are using POSIX ACLs you have more options than<br>
you will ever need for this situation. Keep it simple is the best way<br>
for system administration.<br>
<div class="im"><br>
<br>
><br>
><br>
> I got a suggestion from some one<br>
><br>
> Approach 1)<br>
> Based on the ip you change the shell. If it's just for read only a<br>
> jail would be fine.<br>
><br>
> but how do I change shell based on IP?<br>
><br>
> Approach 2)<br>
><br>
> to have two ssh instances. Let's say port 22 and port 24. Port 22 is<br>
> for read only, while port 24 is for full access<br>
><br>
> so how can it be possible to give port 22 only read only access to SSH<br>
><br>
><br>
<br>
</div>Maybe you can tweak PAM and do some shell scripting to achieve both<br>
aproaches. But why? If you do it not right you might break your<br>
system. I really do not know what this could be good for... Using 2<br>
users is the easiest way.<br>
<br>
Bye,<br>
<br>
Michael<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.10 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br>
iEYEARECAAYFAk1otAgACgkQBvfZ5167qr9nZACfbeMQNGdRo+ELN8wB0GwZc12R<br>
fbYAnjoZwnAN+YpzhgcgjZwrAlFmK5jy<br>
=nExp<br>
-----END PGP SIGNATURE-----<br>
<div><div></div><div class="h5"><br>
<br>
--<br>
ubuntu-server mailing list<br>
<a href="mailto:ubuntu-server@lists.ubuntu.com">ubuntu-server@lists.ubuntu.com</a><br>
<a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-server" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-server</a><br>
More info: <a href="https://wiki.ubuntu.com/ServerTeam" target="_blank">https://wiki.ubuntu.com/ServerTeam</a><br>
</div></div></blockquote></div><br>