I would like to have at least two users signing in the same home folder, so them need to have full access to this folder, but with different 'profile' behavior.


  • user1 : /home/foo-folder -> .profile -> exec foo-program
  • user2 : /home/foo-folder -> .profile -> shell

host-bar - Need access to /home/foo-folder on host-foo without password:

ssh user2@host-foo ls

Each one user needs to have different 'profiles' (or something like that), where one cannot have access to the shell, so he'll have a program being auto-run at login (eg: exec foo-program, in .profile), and the other one user needs direct access to the shell prompt.

The other aspect is the need to authorize the 'user with shell access' to sign in without password through ssh. Keep in mind that ssh requires home folder to deny write access on 'group' and 'others' permissions. So, I cannot have two users expanding permissions to group.

Is this possible ? How ?

  • use $LOGNAME var and an if-then-else ? – Archemar Aug 14 '15 at 14:50
  • 2
    Why have the same directory? Seems rather unnecessary and better just to give them their own directory for them to arrange and use without the other person trampling over them – Ed Heal Aug 14 '15 at 14:51
  • 1
    @EdHeal: I need two ways to sign in to the same folder, one will auto-run a program, another one a shell access. – Luciano Aug 14 '15 at 14:53
  • 1
    You could add a second user with the same uid as the first, but with a different home directory. – Andy Dalton Aug 14 '15 at 17:58
  • 1
    @MarkPlotnick, I haven't it, I need it. That is que question, how to ? – Luciano Aug 17 '15 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.