Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
07-15-2004, 03:39 AM
|
#1
|
|
LQ Newbie
Registered: Sep 2003
Posts: 5
Rep:
|
how to protect a file with password
l've got a stupid but an inteligent question??? my question is this :
hoe do l place a password on a normal file in linux.??? cos' this is
simple in windows. please note am not talking about [.htaccess or
.htpasswd ] that are used for Apache. But am asking of how l can place a
password access on the scripts or configurazione files. e.g if l have a
script called "/usr/sbin/bobgodwinx" l would like to protect it with a
password so that when l do for example " vi /usr/sbin/bobgodwinx" l
should be asked a password
|
|
|
|
07-15-2004, 08:57 AM
|
#2
|
|
Member
Registered: Jan 2004
Location: Duesseldorf /Germany
Distribution: Gentoo amd64 / Debian
Posts: 226
Rep:
|
AFaik,
the linux way is to encrypt the file,
use a password as passphrase or key.
To use: decrypt -> use (-> encrypt again, or delete decrypted file)
You could also write a small script which take 2 params: file and passphrase.
Encrypts the file to a teporary file, lets you use it,
and ereses the tempfile afterwards...
Should not be to hard..
|
|
|
|
07-18-2004, 04:48 AM
|
#3
|
|
Senior Member
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794
Rep: 
|
Or use user and group permissions so the system automatically knows if you should be able to read, write and/or execute the file or not...
|
|
|
|
07-19-2004, 07:00 AM
|
#4
|
|
LQ Newbie
Registered: Sep 2003
Posts: 5
Original Poster
Rep:
|
please can some make an example on how to encrypt files or directories with a key or passwd thanks
|
|
|
|
07-19-2004, 10:45 PM
|
#5
|
|
Guru
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672
Rep:
|
do yo have KDE ? kde has a nice graphical frontend to GPG called KGPG (or is it KPGP?)
PGP = Prety Good Privacy
GPG = GNU/Linux version of PGP
but you do know that if you 'chmod 600 /path/to/file' then that file will only be readable to you (and root). no need for encryption.
you may also want to look into encrypted partitons. it allows you to encrypt a whole disk, or directory.
|
|
|
|
07-20-2004, 12:55 AM
|
#6
|
|
Senior Member
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038
Rep:
|
bobgodwinx: this may be simple in window, but it really doesn't do a damn thing, all it does is make it so windows doesn't let people that don't know the password use the file, but anyone can pop in a boot disk and go around windows all together (including the files password)
if its sensitive data, then encryption is best, if its lots of files, encrypt the disk partition (like to get encrypted directories)
|
|
|
|
07-20-2004, 08:11 AM
|
#7
|
|
LQ Newbie
Registered: Sep 2003
Posts: 5
Original Poster
Rep:
|
please can some make an example on how to encrypt files or directories with a key or passwd thanks. e.g l would like to encrypt /etc/samba/smb.conf with the following password 123456
can some make a command example please it's very important cos' CHMOD can't give passwd access it only gives read write and excution access. thanks
|
|
|
|
07-20-2004, 08:47 AM
|
#8
|
|
Guru
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672
Rep:
|
why would you want to encrypt samba.conf ?
you do realise that that would prevent samba from reading the file right ?
maybe you do not understand what encryption is ?
as for the exaple you want... that will come in the form of documentation with kgpg and gpg.
if you want to encrypt a whole disk, you will need to re-compile a 2.6.4 or above kernel and to use dm-crypt. (loop-aes is a mess, and crypto-loop is depreciated)
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:50 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|