Programming :: Script To Search Users Home Directories For Certain Words?

Feb 20, 2011

I am trying to create a bash script that will search all users home directories on a system for words like quit, steal, kill etc. Pretty sure I'm going to be using grep /home. The only thing is that obviously a word like 'kill' could have normal uses too like "I need to kill the process." How would I go about flagging a user with the word/phrase found, and the path while also omitting legitimate uses?

View 1 Replies


ADVERTISEMENT

Red Hat / Fedora :: Restrict Users To Their Home Directories And Allow Admins To Have Different Home Directories?

Jan 20, 2010

Is it possible to restrict users to their home directories and allow admins to have different home directories? Essentially I want users to have a folder in /var/www/html/$USER and admins to have either unrestricted access or have their root directory be ./ or /www or /etc. I have is set now so users have access to thier home direcotry but I need to upload web files as admin.

So far I have created:
chroot_list
user_list

[code]....

View 1 Replies View Related

General ::anything Special About Home Directory Before Users' Home Directories Are Stored There

Jun 19, 2010

Is there anything special about a home directory before users' home directories are stored there, or is just as typical as any other "empty" folder?Let me just cut to the chase, but please no ear ringing about the folly of messing around as root, particularly with directories at root level. I know it's considered stupidity, but I deleted my home directory.

Is there an easy way to restore a working home directory? I tried copying /etc/skel under root, but I'm not sure what a home directory should look like once it has been restored. Besides . & .., there were .screenrc & .xsession in my home directory when I copied /etc/skel. Are these files suppose to be in "/home" or "/home/~" or both?

View 10 Replies View Related

General :: Add Directories To A New Users / Home?

Mar 31, 2011

I don't quite understand /etc/skel. I know that everything in /etc/skel will effect all NEW users, and that's about it.

Basically, what I'm trying to do is add the directories "home" and "work" to the users /home directory.

How do I do this?

View 2 Replies View Related

Fedora :: Permission To Access Users' Home Directories?

Jan 25, 2011

I'm a refugee from WindowsXP, running Fedora 14 with three user accountsMy problem is that I need the primary user (userd 500) to be able to have full access all other users' files in their home directories so that user can copy, move, delete, etc.I tried making that user a member of the other users' groups - but I still get the 'not got permission' error when I try to access their home directories

View 8 Replies View Related

Server :: Chroot Users To Thier Home Directories?

Dec 11, 2010

How can i chroot group of users to thier home directories and they have ssh access on RHEL 5.5 .. i tried many tuts but it was about chroot services.

View 2 Replies View Related

Ubuntu Servers :: Placing Quota/cap On Users' /home Directories?

Jul 28, 2010

I have my home server setup, running 10.04 x64. The OS is installed on a 300GB WD Blue drive, and I have a RAID5 array md0, consisting of 4x 2TB WD Green drives, mounted as /home. I am sharing the home directories using samba and using them to back-up the other computers in the house. I have created a user account+password for each computer, giving it its own "/home/computername_backup/" directory to store it's backups in.

Computers being backed-up:(750GB) Gaming PC running Win7 Ultimate x64
(30GB + 2TB) HTPC running Win7 Home Premium x64
(32GB) Netbook running Win7 Home Premium x32
(250GB) 2 Macbook Pros Running OS X 10.6.4 (tweaked to allow time machine to recognize the samba share as a time machine volume

Question: 5.37TB of /home seems good for now, and I haven't run into any problems so far, but I don't want to have to keep checking. I'd like to put a size cap on each user's home, to prevent one of the computers from gobbling up all the space. Is there an easy (or hard) way to configure this type of thing? My Macbook, for example, only has a 250GB HD. I could give it 3-400GB of space for its home and that would be plenty - whenever it filled its /home/, it would start erasing the oldest backups. If there is no size limit, I believe it will just continue to grow until all the free space is gone.

Considerations: Right now, the HTPC is storing all its media locally (on the installed 2TB drive). However, I've already used 3/4 of the space and the HPTC enclosure can only hold one drive. My plan moving forward is to have /home be used to store media files (iTunes music for all computers and tv/movies for the HTPC), which is another reason I'd like to ensure that the backups don't take up all the space.

I realize I could create a partition for each computer, but I'd prefer not to go down this route. This would seem an untenable tactic if I added another computer next month, or if I realized that the partition was too small.

View 2 Replies View Related

Server :: Setup Vsftpd With AD Users Without Home Directories Created?

Jul 3, 2009

I'm testing a Debian Lenny virtual machine to simulate my ideal setup for FTP server (with vsftpd): I want all internal users (corporation users with Active Directory accounts) to ftp into the same directory (i.e. /var/FTP/AD-DOMAIN/) and external users (customers) to ftp into their home directories (created manually on request).

I added user_config_dir=/etc/vsftpd_user_conf option in /etc/vsftpd.conf file and I've created /etc/vsftpd_user_conf/domain-user1 with local_root=/var/FTP/AD-DOMAIN

I have setup vsftp so I can ftp with every external and internal user chrooted and is working properly. AD validation for internal users and "normal" validation (via /etc/passwd) for external users work perfect.

I can FTP this server into /var/FTP/AD-DOMAIN with any AD user with its home directory created (i.e. /home/AD-DOMAIN/domain-user1/) but if I try to ftp with any AD user without its home directory created I get the error "500 OOPS: cannot change directory:/home/AD-DOMAIN/domain-user2"

I have found some references (http://wiki.flexion.org/FtpServer.html and http://howto.gumph.org/content/setup...ies-in-vsftpd/) about vsftp PAM authentication so I would supposedly get rid of the error message and the user would log into /var/FTP/AD-DOMAIN without problems, but I can't figure out how to setup my FTP server.

View 1 Replies View Related

Ubuntu Servers :: Mounting Home Directories Of Users To Respective Desktops

Jan 8, 2010

I'm trying to mount the home directories of the users on the server to the respective desktops. I would like to use the libpam-mount module. do you guys know, how make it run? I am using 9.10 both server and desktop and the most recent pam-mount module. I know that the /etc/security/pam_mount.conf.xml needs to be edited. I added the following to it:
Code:
<volume user="username" fstype="cifs" server="IP-Server" path="/home/username" mountpoint="/media/server" />

View 9 Replies View Related

Red Hat / Fedora :: SELinux Is Preventing The Samba Daemon From Reading Users' Home Directories

Sep 1, 2010

My Fedora box is giving me an SELinux security error:

Code: Summary:

SELinux is preventing the samba daemon from reading users' home directories.

Detailed Description:

SELinux has denied the samba daemon access to users' home directories. Someone
is attempting to access your home directories via your samba daemon. If you only
setup samba to share non-home directories, this probably signals an intrusion
attempt. For more information on SELinux integration with samba, look at the
samba_selinux man page. (man samba_selinux)

Allowing Access: If you want samba to share home directories you need to turn on the
samba_enable_home_dirs boolean: "setsebool -P samba_enable_home_dirs=1"

Fix Command:

setsebool -P samba_enable_home_dirs=1

Additional Information:

Source Context system_u:system_r:smbd_t:s0
Target Context unconfined_u:object_r:user_home_dir_t:s0
Target Objects /home/micah [ dir ]
Source smbd

[code]....

View 2 Replies View Related

Programming :: Search For Directories With The Highest Characters In Their Names?

Aug 29, 2010

How do you tell a shell script to search for the directory within another directory (in this case /lib/modules) whose characters in its name (in this case numbers) are highest? I want to be able to tell mkinitramfs in a script to be able to see the highest possible kernel version in the /lib/modules directory.

View 2 Replies View Related

Programming :: Bash Script For Cleaning Home Directories

Jul 25, 2011

Im running on Solaris 10 and I am trying to write a script that will look at all the directories in export.home and then grep for the those in passwd and will display the directories that don't have a password associated with them

Here is what I got so far but its not working.
#!usr/bin/bash
for i in 'ls /export/home'
do
test='getent passwd | grep $i'
if [ $test="" ]
then
echo "No Home Diectories Found $i"
fi
done

All this does is display what was listed in the export.home. What I want it to do is just display what was not found in password.

View 2 Replies View Related

General :: Multiple Users To Create Directories Over SFTP So The New Directories Keep The Same Permissions?

May 15, 2011

I want to make a webserver with multiple users allowed to login through SFTP to a specific folder, www.Multiple users are added, lets say user1 and user2, and all of them belonging to the www-data group. The www directory has an owner www-data and a group www-data.

I have used chmod -R 775 on the www folder, but after I try to create a folder test through my SFTP server (using Filezilla) the group of the directory created has only r and x permissions, and I am not able to log in with the second user user2 and create a directory within www/test due to a lack of w permission to the group.

I also tried using chmod 2775 on www directory, but without luck. Can somebody explain to me, how can I make it so that a newly created directory inherits the root directory group permissions?

View 2 Replies View Related

Ubuntu :: Use Multiple Words / Terms (boolean AND) With Gnome Search Tool

May 27, 2010

I just want to search file names, not their content.

Using gnome-search-tool, if I search for "word1 word3" I can't find "word1 word2 word3.txt" but I do find it (and too many others) if I just search for "word1"

I would have thought a boolean AND search would just be automatic, but I guess not. I've already come across searchmonkey, but I'm not smart enough to figure out how to set it up to do this - i.e. I don't want to have to use regular expressions or be typing "*" all over the place.

P.S. I do use google desktop search, but I hate using it as the results are way too narrow to be of any use and haven't been able to figure out how to widen it.

P.P.S. I also found this: In terminal type gconf-editor and find gnome-search-tool in the Apps. Then look for the field quick_search_second_scan_excluded_paths and change the slash to nothing, i.e. delete the "/".

It worked for my ubuntu 10.04 pc, but not this one (ubuntu 9.1) - so I thought maybe there's another way...

View 5 Replies View Related

Programming :: Identify Users Who Forbidden Files In Home Directory

May 16, 2011

I have to create a script to identify those users who have un-sanctioned (forbidden) files in their home directory. I tried something like this (this is a try and I need some opinions):

Code: #!/bin/bash
user_belongs() {
if `groups $var1 | grep $var2`
then
return 0 else
return 1
fi
} .....

View 1 Replies View Related

Software :: Using Find To Only Search Specific Directories?

Jan 9, 2010

how the "-prune" option works. I've searched quite a bit on line, and as far as I can tell, "-prune" works exactly the opposite as it says.

I'm using Apt-proxy, and I want to scan through the folders, and find files that end with "*.bz2" The problem is that the search takes a while because of all the "*.deb" files. Fortunately, they're stored in their own folder:

/var/cache/apt-proxy/ubuntu
/var/cache/apt-proxy/ubuntu-security
/var/cache/apt-proxy/partner
each have two folders:

[Code]....

View 5 Replies View Related

General :: Search Multiple Words In Multiple Lines?

Dec 16, 2010

How to search multiple words in multiple lines, inside a directory including sub-directory? Pls. give easy example. I want to search the files (in /xx folder and all subfolders) that have header.h included and used x() function. I tried $grep -r "header.h" | grep -r "x(" /Folder/subfolder/ > search.log

View 7 Replies View Related

Programming :: C++ Programming With Simple RTAI Functions Outputing Words?

Apr 11, 2011

I need help as I am not proficient with Linux C++ Programming. There are two parts which I need to do in the coding provided below.

1. Produce the program so it can output the word "Hey there!" and wait two minute and print the word "See you later!".

2. Produce the program that will output the text "Cool" every 20 seconds by setting a periodic task.

Quote:
#include <linux/kernel.h>
#include <linux/module.h>
MODULE_LICENSE("GPL");
int init_module(void)
{
printk("Hey there!

[Code]...

View 3 Replies View Related

Security :: Sudo For Users But Only +r On Other /home/users Ubuntu 10.04 ?

Nov 1, 2010

We are trying to set up a classroom training environment where our SIG can hold classes for prospective converts from Microsoft/Mac. The ten machines will have /home/student01..10 and /home/linsig01..10 as users. We want /home/student01 to be able to explore and sudo so they can learn to administer their personal machines at home. We don't want them to be able to modify (sudo) /home/linsig01. I've seen the tutorial on Access Control Lists but I'd like other input so we get it right the first time.

View 3 Replies View Related

General :: Midnight Commander - Exclude Some Directories / Patterns When Doing Search

Apr 7, 2011

In Midnight Commander, is it possible to exclude some directories/patterns/... when doing search? (M-?) I'm specifically interested in skipping the .hg subdirectory.

View 1 Replies View Related

General :: Access To Certain Directories To Ssh Users

Apr 17, 2010

I want to restrict access to certain directories to my ssh users but allow them to read files by known path from there(mostly it's meant to be done by applications).

View 2 Replies View Related

CentOS 5 :: Mapping Directories To Users?

May 6, 2009

Problem: I need to map directories to a user's home directory when they log in.

For example, I need to map /school/homework/ to user "steve" in his home directory when he logs in. I'm guessing I could use a logon script, but I can't figure out what command I should be putting in the script. I've been searching for hours through man pages and googled it a ton and can't find anything on it.

View 3 Replies View Related

Programming :: Add Text Between Two Words?

Mar 3, 2011

For example if i have the following "OneThree" and i want to add the word "Two" between "one" and "three". To have "OneTwoThree" How can i do this?

View 2 Replies View Related

Programming :: Array Containing Words In C?

Sep 24, 2010

This array is supposed to contain 12 elements (names of the month) What I want to achieve is that depending on some user input (a number 1-12) a full name of one of the months will be displayed, eg.

Code:
scanf("%d", &month);
printf("The month is %c", months_names[month]);

View 6 Replies View Related

Server :: Restricting Users To Two Directories Centos 5.3?

Feb 16, 2010

I need some kind of step by step process to restrict my users to only have access to directories that I specify ? For example user joe can only access his home directory, read access to /tmp and read access to /var/log/httpd

View 1 Replies View Related

Programming :: Php Can Recognize The Number Of Words?

Jun 16, 2010

User submits a ms word file, and the php can recognize the number of words? Is it only possible for ms win server?

View 1 Replies View Related

Fedora Security :: Give FTP Control Of Different Directories To Different Users

Aug 24, 2010

I have my own dedicated server box running (using it for game servers). I access it via ssh and I have root control of it. It has FEDORA Operating System. I wanna give FTP control of different directories to different users. Right now there are no other FTP users except root. I have installed vsftpd and dont know what should I do next? How do I add users (who can read/write/delete files) and How do I restrict them to their home directory?

Here is what I want:
username:client1
password:12345
home directory: home/server1
username:client2
password:12345
home directory: home/server2

View 1 Replies View Related

Ubuntu :: Using Sudo To Restrict Users For Accessing Directories?

Jun 20, 2011

Is it possible to restrict users with 'sudo' from accessing certain directories? Rather than just exclude cd and ls from the sudo privileges, that is.

View 5 Replies View Related

Programming :: Awk To Extract Phrase Between Two Words On A Line?

May 25, 2010

im trying to find a way to extract the phrase between the words Connection and is (ie the underlined words below). Can we use awk to do this? How? Is it the best command to use?

Code:

[06:25:00][i] Connection at Plant A is live
[06:25:00][i] Connection at Building_C is not live
[07:25:00][i] Connection at Terminal D is down

View 12 Replies View Related

Programming :: Display Every Line That Does Not Contain One Of Listed Words / Fix It?

Feb 17, 2010

I am trying to eliminate false lsof file records but it does not work code...

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved