0

Create a file in linux by user user1 and it should not be writable by user1 but user2 can able to read, write.

22nd Jul 2018, 9:07 AM
Srikar Bharade
Srikar Bharade - avatar
6 odpowiedzi
0
you can do it by using open API. please read abote mode_t of open API. Read a man page of open API you will get the idea. int open(const char *pathname, int flags, mode_t mode);
22nd Jul 2018, 9:48 AM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar
0
𝕾𝖆𝖌𝖆𝕿𝖍𝖊𝕲𝖗𝖊𝖆𝖙 💯 is this possible in Linux environment
22nd Jul 2018, 10:25 AM
Srikar Bharade
Srikar Bharade - avatar
0
yes but you have to write c code. Do you want that in gui mode?
22nd Jul 2018, 10:36 AM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar
0
no I want in linux shell
22nd Jul 2018, 11:15 AM
Srikar Bharade
Srikar Bharade - avatar
0
using basic Linux commands such as chmod and chown
22nd Jul 2018, 11:15 AM
Srikar Bharade
Srikar Bharade - avatar
0
create a file and use chmod like below: chmod 754 myfile
22nd Jul 2018, 11:27 AM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar