Subject: | |
From: | |
Reply To: | |
Date: | Thu, 26 Sep 2013 17:00:29 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
One minor note,
Read isn't needed on the directories if the user/script/etc knows the path. If the filename is known (no requirement to do a ls on the directory), then execute is sufficient. If you give read, then all the filenames in your directory are revealed (but not necessarily the contents).
----- Original Message -----
> From: "Earl Ramirez" <[log in to unmask]>
> To: "Mahmood Naderan" <[log in to unmask]>
> Cc: [log in to unmask]
> Sent: Thursday, September 26, 2013 4:43:31 PM
> Subject: Re: How a user can execute a file from anothe user
>
...
> Sorry, I just saw the mistake, I forgot to mention that you need to
> grant access to the your home directory as mentioned by Mark.
>
> chmod o+rx /home/mahmood (I added read as the user didn't have
> permission to access the directory.
>
> You should now be able to execute the script as another user.
>
> For your reference:
>
> I created a folder named "shared" in user2 home directory
>
> @lab19 ~]# ls -la /home/user2
> total 40
> drwx---r-x. 5 user2 user2 4096 Sep 26 15:57 .
> drwxr-xr-x. 5 root root 4096 Sep 26 15:53 ..
> -rw-------. 1 user2 user2 1387 Sep 26 16:27 .bash_history
> -rw-r-----. 1 user2 user2 18 Feb 21 2013 .bash_logout
> -rw-r-----. 1 user2 user2 176 Feb 21 2013 .bash_profile
> -rw-r-----. 1 user2 user2 124 Feb 21 2013 .bashrc
> drwxr-x---. 2 user2 user2 4096 Nov 11 2010 .gnome2
> drwxr-x---. 4 user2 user2 4096 Dec 20 2012 .mozilla
> drwxrws---. 2 user2 public 4096 Sep 26 15:57 shared
> -rw-------. 1 user2 user2 641 Sep 26 15:57 .viminfo
>
> Created the script and was able to execute it from the user name
> user1
>
> @lab19 ~]# ls -la /home/user2/shared/
> total 12
> drwxrws---. 2 user2 public 4096 Sep 26 15:57 .
> drwx---r-x. 5 user2 user2 4096 Sep 26 15:57 ..
> -rwxrwx---. 1 user2 public 18 Sep 26 15:57 script1
>
> user1@lab19 ~]$ /home/user2/shared/script1
> Filesystem Size Used Avail Use% Mounted on
> /dev/mapper/vg_lab11-lv_root
> 5.5G 2.8G 2.5G 54% /
> tmpfs 504M 232K 504M 1% /dev/shm
> /dev/vda1 485M 92M 369M 20% /boot
> /dev/md127 2.0G 100M 1.9G 5% /home/labs
>
>
>
>
> --
>
>
> Kind Regards
> Earl Ramirez
> GPG Key: http://trinipino.com/PublicKey.asc
>
|
|
|