Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| 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. |
|
 |
04-20-2006, 05:20 PM
|
#1
|
|
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Rep:
|
Changing ownership of directories; /var/log/messages questions
Simple questions as I am learning command line:
1) How does a user take ownership of a directory in the command line?
example:
Code:
drwxr-xr-x 3 root root 152 2006-03-12 22:52 mp3
Do I use the command chown?
2) how do I clear my /var/log/messages? Just delete it?
2a) How do I tell the system what I do and do not want logged in the /var/log/messages? At the moment it's logging in silly stuff like the websites I view. The Linux I am using is currently set as a DNS server, too!
Thank you
|
|
|
|
04-20-2006, 05:25 PM
|
#2
|
|
Senior Member
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,477
Rep:
|
A directory or file already has ownership when it is created, owned by the creater. The chown command is used to change the ownership of the file or directory and can only be performed by the owner of the file or by root.
Simple example:
# chowm bob myfile (sets the ownership of myfile to bob)
Hope this helps
Bob
|
|
|
|
04-20-2006, 05:27 PM
|
#3
|
|
Member
Registered: Apr 2006
Location: Pittsburgh
Distribution: Debian Sid AMD64
Posts: 296
Rep:
|
Quote:
|
Originally Posted by Micro420
Simple questions as I am learning command line:
1) How does a user take ownership of a directory in the command line?
example:
Code:
drwxr-xr-x 3 root root 152 2006-03-12 22:52 mp3
Do I use the command chown?
|
Right. If you wanted to give this "mp3" directory to a user called "user2", you would type If you also wanted to give that user all of the files and directories that are inside of "mp3", you would do
Quote:
|
Originally Posted by Micro420
2) how do I clear my /var/log/messages? Just delete it?
|
You can delete the individual files from it, but then you need to create new, empty ones, and to restart syslogd. I'd suggest you don't bother - these files will get rotated and old entries will "expire".
Quote:
|
Originally Posted by Micro420
2a) How do I tell the system what I do and do not want logged in the /var/log/messages? At the moment it's logging in silly stuff like the websites I view. The Linux I am using is currently set as a DNS server, too!
|
Edit /etc/syslog.conf .
|
|
|
|
04-20-2006, 08:04 PM
|
#4
|
|
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Original Poster
Rep:
|
Thanks! the chown command worked!
I found the configurations for my /var/logs. In SuSE 10 they are located in /etc/syslog-ng/syslog-ng.conf.in. I used 'vi' to look through it and it looks complex so I won't touch it. I'll try to find some online resources about this.
My next quick question is the 'sudo' usage. How do I give certain users privileges to use the sudo command?
|
|
|
|
04-20-2006, 08:16 PM
|
#5
|
|
Member
Registered: Apr 2006
Location: Pittsburgh
Distribution: Debian Sid AMD64
Posts: 296
Rep:
|
Quote:
|
Originally Posted by Micro420
I found the configurations for my /var/logs. In SuSE 10 they are located in /etc/syslog-ng/syslog-ng.conf.in. I used 'vi' to look through it and it looks complex so I won't touch it. I'll try to find some online resources about this.
|
Ah, SuSE uses Syslog-NG. I don't know it.
Quote:
|
Originally Posted by Micro420
My next quick question is the 'sudo' usage. How do I give certain users privileges to use the sudo command?
|
As root, run the "visudo" command. This will let you edit the sudo config file. It's very flexible - the "sudoers" man page documents the possibilites in excruciating detail. I just use simple ones like this:
Code:
ataraxia ALL=(ALL) ALL
|
|
|
|
04-21-2006, 12:58 AM
|
#6
|
|
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Original Poster
Rep:
|
Thanks for the visudo command. I added myself in and can run the 'sudo' command,
Code:
#User privilege specification
root ALL=(ALL) ALL
micro420 ALL=(ALL) ALL
I then run a sudo command:
Code:
sudo cat /etc/shadow
However, I am still asked for the password (root password). Inputting my user password does not work, but putting in the root password works.
I then tried
Code:
sudo -u micro420 cat /etc/shadow
I then get the error:
cat: shadow: Permission Denied
How do I get the user password to work with sudo?
Last edited by Micro420; 04-21-2006 at 01:07 AM.
|
|
|
|
04-21-2006, 08:39 PM
|
#7
|
|
Member
Registered: Apr 2006
Location: Pittsburgh
Distribution: Debian Sid AMD64
Posts: 296
Rep:
|
That's really weird. I've never had sudo ask me for the root password. You weren't doing something silly like running your "sudo cat /etc/shadow" when you were already root or something, were you?
|
|
|
|
| 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 06:14 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
|
|