how other user cannot read my script?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how other user cannot read my script?
# 8  
Old 09-29-2006
You can "hide" a file or directory in unix. Just add a "." at the begining of the file's name and users won't see it unless they do "ls -a" Smilie
Code:
$ touch one two .three
$ ls
one two
$ ls -A
one two .three
$

But, if you don't want other users to list your files in some_dir, just "chmod o-x /some_dir"

Though, as it's been said before, if you do not want anybody be able to read your files, you should use ecryption...

Corona688, I think tbdo88 is using VIM in Linux, which has that option Smilie
I my Linux box, VIM v7.0.17 has it.

Regards.
# 9  
Old 09-29-2006
Smilie thank you very much.
# 10  
Old 09-29-2006
Quote:
Originally Posted by Corona688
which version of vi is this? mine doesn't have it.
All version of vi. I have been using this feature for more than 15 years. Check your man page first on vi:

-x Encryption option. When used, vi simulates the X com-
mand of ex and prompts the user for a key. This key is
used to encrypt and decrypt text using the algorithm
of the crypt command. The X command makes an educated
guess to determine whether text read in is encrypted
or not. The temporary buffer file is encrypted also,
using a transformed version of the key typed in for
the -x option. If an empty encryption key is entered
(that is, if the return key is pressed right after the
prompt), the file will not be encrypted. This is a
good way to decrypt a file erroneously encrypted with
a mistyped encryption key, such as a backspace or undo
key.
# 11  
Old 09-30-2006
Quote:
Originally Posted by tbdo88
All version of vi. I have been using this feature for more than 15 years. Check your man page first on vi:
Ok, It's fantastic the fact that your vi has had that option for at least 15 years. I swear I work with several AIX machines, less than 4 years old, and neither vi nor vi's man page says anything about "-x". Be sure that I always check man pages before posting, and I suppose that Corona688 does the same. NOT all versions of vi have "-x".

Regards.
# 12  
Old 09-30-2006
Quote:
Originally Posted by grial
You can "hide" a file or directory in unix. Just add a "." at the begining of the file's name and users won't see it unless they do "ls -a" Smilie
Code:
$ touch one two .three
$ ls
one two
$ ls -A
one two .three
$

But, if you don't want other users to list your files in some_dir, just "chmod o-x /some_dir"

Though, as it's been said before, if you do not want anybody be able to read your files, you should use ecryption...

Corona688, I think tbdo88 is using VIM in Linux, which has that option Smilie
I my Linux box, VIM v7.0.17 has it.

Regards.
Be carefull when you use "." to hide the file. "." has feature called self-autoexecution. It will automatically execute when you login. - Just FYI.
# 13  
Old 09-30-2006
I've never actually seen this option myself, but it seems quite useful.

Just out of interest, when using it to create a script, how do you convert it to non-encrypted form for execution?

Thanks
# 14  
Old 09-30-2006
Quote:
Originally Posted by tbdo88
Be carefull when you use "." to hide the file. "." has feature called self-autoexecution. It will automatically execute when you login. - Just FYI.
What?
I think you are a little bit confused...
Perhaps you are talking about shell initialization files such as ".profile", ".bashrc", ".cshrc", etc...
The fact that a filename starts by "." has nothing to do with self-auto-execution...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read the USER Quota in SSH

How the User Quota query from an SSH access to Linux Shell. (5 Replies)
Discussion started by: Linuxmann
5 Replies

2. Shell Programming and Scripting

Other user should not read the file but can execute

Hi, I have one script for which I want that other user should not read the script file but can execute. Is there any method ? I tried by giving 711 but it gives Permission denied to other users. For Generic User id as a work around , I have created alias in .bashrc file and other user... (4 Replies)
Discussion started by: Amit Joshi
4 Replies

3. Shell Programming and Scripting

Perl to read user input

I am creating a bash that uses perl . The below code closes before the input is entered. If I run the perl as a .pl it is fine. What am I doing wrong? Thank you :). #!/bin/bash cd 'C:\Users\cmccabe\Desktop\wget' wget -O getCSV.txt http://xxx.xx.xxx.xxx/data/getCSV.csv print... (4 Replies)
Discussion started by: cmccabe
4 Replies

4. UNIX for Dummies Questions & Answers

Read Only user in Vsftpd

HI I have set up vsftp on my Red hat server. Chroot has been set up to control access to each user and folder directories. This all works fine. But i have one directory where i want to chroot but ensure that the ftp access is read only. Any help appreciated thanks Treds (1 Reply)
Discussion started by: treds
1 Replies

5. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies

6. UNIX for Dummies Questions & Answers

Read-only user in AIX

Hi, I want to create a new user,and I want to give read permission to a folder which owned by root. How can I do this? thanks for your helps (4 Replies)
Discussion started by: sersoy
4 Replies

7. Shell Programming and Scripting

Help with Bash piped while-read and a read user input at the same time

Hi I am new to writing script and want to use a Bash Piped while-read and read from user input. if something happens on server.log then do while loop or if something happend on user input then do while loop. Pseudocode something like: tail -n 3 -f server.log | while read serverline || read... (8 Replies)
Discussion started by: MyMorris
8 Replies

8. Shell Programming and Scripting

Shell script to read lines in a text file and filter user data

hi all, I have this file with some user data. example: $cat myfile.txt FName|LName|Gender|Company|Branch|Bday|Salary|Age aaaa|bbbb|male|cccc|dddd|19900814|15000|20| eeee|asdg|male|gggg|ksgu|19911216||| aara|bdbm|male|kkkk|acke|19931018||23| asad|kfjg|male|kkkc|gkgg|19921213|14000|24|... (4 Replies)
Discussion started by: srimal
4 Replies

9. UNIX for Dummies Questions & Answers

Specifying read on dir user?

If I have a number of users all in the same group. How do I give read only access to some of them on everyone elses home directory. Is it possible if they are all in the same group?? So user1,2,3,4 can have read/execute on user1-5 home directory, but user5 can only read only have read... (1 Reply)
Discussion started by: sniff
1 Replies

10. UNIX for Dummies Questions & Answers

getline to read input from a user

Hi, The gcc compiler has warned about using gets(), so I've been trying my hand at getline. Problem is that I've been able to read from a file, but what I really need is to read from a user's input. I want to use getline like a scanf() command, but I can't figure what to substitute for the fp... (6 Replies)
Discussion started by: sdsd
6 Replies
Login or Register to Ask a Question