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
ADVERTISEMENT
Apr 15, 2010
I have to clean the voicemails from asterisk, but I want to keep at least, the voicemails for five days.I started writing a script, but I'm a bit stuck, and I've trying somethings for sometime, but still I can't get itThe hierarchy of Asterisk Voicemails is like this:
default
10000
INBOX
[code]....
View 4 Replies
View Related
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
Feb 11, 2011
It achieves a bash script that takes two parameters (command line). These two parameters must be two paths of two directories (existing, and different such as not being of the other sub-folder). Path1 and path2 are for simplicity.The script will recursively visit the two directories and all sub-directories, sub-sub-directories, etc.. Looking for differences between their contents (files or directories). In particular, suppose that we work with both path1 and path2 directory, and scanned the files contained therein. These situations can occur:
* Path1 exists in a file that is not present in path2: in this case, the script displays the path of the file to you (print screen) and asks if he wants the file is copied in path2 or not. Reads the user's response and acts accordingly.
* Path2 exists in a file that is not present in path1: in this case, the script displays the path of the file and asks if the user wants the file is copied in path1 or not. Reads the user's response and acts accordingly.
* Both path1 path2 in a file with the same name but different contents: in this case, the script displays the path of the two files (which of course will start with path1 and path2 but end with an equal) to the user together with the two dates have been changed last time. Then asks if you want the file to be replaced by one in path1 path2, or that the file is replaced by one in path2 path1, or that both are left unchanged. Reads the user's response and acts accordingly.
* Both path1 path2 in a file with the same name and same content, in which case the script does nothing and proceeds with the next file.This is done for all regular files in path1 and path2. The special file (socket, device, symbolic link ...) are ignored. For folders in path1 and path2 is recursively by:
* Path1 if there is a folder that is not present in path2: in this case, the script displays the path to the folder and asks if you want the folder and all its contents are copied to path2. Reads the user's response and acts accordingly.
* Path1 if there is a folder that is not present in path2: similar at first.
* Both path1 path2 that there are two folders with the same name as the script works recursively on the two folders.
View 2 Replies
View Related
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
View Related
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
Jan 19, 2011
I would like to create a bash menu script for my home server For instance if i were to type ./script It would then bring up 3 options
a. Create a backup
b. Restore files from a backup
c. Quit
If you were to select a or b it should then ask you were you want to backup or restore from. And if i were to type in an incorrect letter i should get an error and take me back to menu. I have attepmted this a view time now and have magaged to get the menu up using parameters
View 9 Replies
View Related
Feb 16, 2011
I'm setting up a Squeeze system with multiple users. I would like to have it the way that no user is allowed to read other user's files. I have searched the net and the forums here and have found quite a lot of stuff but it's all a bit confusing to me.
Some suggest that one should use
dpkg-reconfigure adduser
and select
<no>
But that doesn't do what I'd like to achieve (with a newly created user):
wussy@dorm:/home$ ls -l
[Code]....
View 8 Replies
View Related
Sep 14, 2010
In system info my ext4 /home directory shows total space of 51.7 gigs with 51.5 gigs available.
My ext4 / directory shows total space 19.7 gig and 7.7 gig free. Whenever I install anything it goes to the / (as guess root directory) In Dolphin it shows my /home directory but anything installed under that seems like it installs on the / directory.
If I have 51 gigs free where is it and how do I gain access?
View 9 Replies
View Related
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
Jun 28, 2011
I'm very new to working with the terminal on my macbook pro and am trying to understand how to navigate into certain directories with it. I can't seem to get out of my username directory. I'm trying to access MAMP/htdocs and get those files into my git repository. I'm new to all of this. I am typing and getting this:
David-Adamss-MacBook-Pro:~ davidadams$ cd Applications/MAMP/htdocs/barcodes
-bash: cd: Applications/MAMP/htdocs/barcodes: No such file or directory
I need to get the "davidadams$" out of that line but I don't know how to navigate out of it.
View 6 Replies
View Related
Apr 14, 2010
I'm hoping somebody can find something here that I haven't. I'm trying to use rsync to backup home directories to a nas. First, I NFS mounted the nas and ran an rsync and everything worked out fine. the transfer completed after a few hours and everyting was transferred (lots of stuff!). I then decided that I don't want to leave the nas mounted all the time and I didn't want to automate mounting and unmounting of the nas as I didn't think I could produce a script that would work reliably enough. So I decided to start an rsync daemon on the nas and upgrade via that. I run the following command (results are included. the ^C is me killing it after it hangs).
Code:
ryan@server:/etc/backup$ sudo rsync -ax --stats --progress --delete /data root@192.168.0.98:backups1
root@192.168.0.98's password:
sending incremental file list
data/home/user/Documents/
data/home/user/Documents/The File.wmv
[Code]...
View 3 Replies
View Related
Sep 18, 2010
I'm using Edubuntu 10.04 in my classroom. I use an administrator account. There are about 8 student accounts on the computer, created as desktop users. I would like to login with my account and be able to view, create, and delete files in the students' home directories. However, I can't figure out how I would give myself this permission.
I've tried sudo chmod, but that won't work, because I'm not the owner of those files.
I've tried sudo chown, but that won't work, because the students need to be owners of their own directories.
So, what is the tactic to use here?
View 3 Replies
View Related
Oct 19, 2010
I'm looking for the best distributed filesystem to share my home directory among all my computers, and I'm interested in what advice I could get here.
Here are my requirements:
1) It must be completely POSIX compliant, because I've noticed that many programs will break if not.
1a) Must support file locking (i.e. flock()) preferably sharing lock advisories between the clients
1b) Must support hard links, and be able to recognize a hard link connection by looking at the number of references
2) It must have encryption, and security suitable for it to be exposed to the internet.
2a) I would like to use password-less authentication. Preferably SSL client certs (HTTPS style). Static keys (SSH style) are also fine. I would begrudgingly accept a password authenticated system if it used a fairly secure challenge/response algorithm if it met all of my other requirements. (Extra points if it supports PKCS#11 and thus supports smart cards)
2b) Encrypted traffic must be an option.
2c) No thanks to kerberos. It was too annoying to maintain when I tried it before and I don't like passwords.
3) Preferably, it should be stable and fairly easy to maintain.
4) Optionally, it should be tolerant of network drops, and reconnect automatically as needed, because my laptop wireless is a little flaky sometimes.
View 4 Replies
View Related
Jun 4, 2010
Why when I command "useradd -m barth" do I get the error message: "cannot create directory /home/barth"? It only does this when a partition is mounted to /home.
View 14 Replies
View Related
May 27, 2011
I have a server which serves up home directories and users for the other machines. So when you login to one of the other machines your home directory is stored on the server. The problem here is, some of the client machines are running Red Hat and others are running Ubuntu and this causes configuration errors in some applications (e.g. Gnome).
View 1 Replies
View Related
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
Feb 12, 2010
I was wondering if anyone could point me in the direction of any howtos around this. I have 3 computers:
Desktop - Dendrite - Ubuntu 9.10
Laptop - Axon - Ubuntu 9.10
Netbook - Synapse - Eeebuntu 9.10
All with their own home drives. My media (music, films, photos etc) is kept on a separate (Vista) partition on my Desktop with symlinks from my home directory on Dendrite. Ideally, I'd have the /home directory synced across all 3 computers. I had been toying with the idea of a networked /home kept on an external HD plugged into synapse, but not sure how this would work out with Axon out of the reach of the network. I have dyndns set up and can access the home network over ssh, but obviously that's impractical (I assume) for a home drive.
Thoughts? Ideas? Pointers? I'm comfortable playing around with fstab, nfs and the terminal, but still very much a beginner.
View 6 Replies
View Related
Jul 13, 2010
I want to share home directories from two different machines so that I can log on to both using the same account.
One idea was to host the home directory on a server and mount it to a local directory. I don't think this will work though, because I'm pretty sure the directory wont be mounted until the logon session starts and I'm guessing it wont without the appropriate home directory.
So the question becomes, what tells the OS where the home directory is in the first place. Yes it's in a default place but that path as to be stored in some config file somewhere right?
But another problem is... If the server goes down, I'll have to make sure I can log on via root at the logon screen/get into a terminal/use LiveCD to get access.
It wouldn't be too much of a problem to create an account on each machine, all my media will be on the server anyway. But if I create an account on one, it would be nice if it was automatically added to the other. And it would be great for keeping settings if I want to do a compete wipe if I'm upgrading the file-system or something. I suppose I could just do a backup like everyone else..
View 1 Replies
View Related
Apr 26, 2011
I have a perplexing problem that I was hoping some of you might help me solve. My servers run 10.10 and also serve as standalone LTSP hosts - none of this is terribly relevant I hope. Recently, a user complained of permission problems and so I ran a simple command:
Code:
chown -R username:username /home/username/*
and
[code]...
View 4 Replies
View Related
Feb 8, 2010
I am runnin CentOS 5.4 on a machine wiht 2GB of ram. of that 2GB free -m shows that 1.8 is being used. I wanted to find out what was consumign the RAM. I came across .mozilla folder in every users home directory. I am thinkning, is this machine some kind of GUI that is consuming the ram?I did ps aux | grep gnome and ps aux | grep kde but that came up with nothing.rpm -qa | grep gnome showed lots of gnome python RPM's.I am using ssh to connect to the machine and can not log in locally to see since it is at a remote location. Is there any way of finding out if a GUI is running, if so how would I uninstall it?
View 3 Replies
View Related
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
Jul 10, 2011
I have recently joined an 11.04 server to an AD and want to configure home directories based on group membership for all AD users that login. Basically, I want one home directory for "Domain Users" and another for "Domain Admins".
View 8 Replies
View Related
Feb 7, 2010
In my desire to learn, mess around and set up something useful on my home network, I'm looking for something that can do centralized login and remote home directories. When someone in my family logs in to a computer, windows or linux based, I want them to be able to use their credentials, then have their remote drive mounted and ready for use. I've looked over ldap solutions, attempted to set up an OpenLDAP server and realized I have no idea what was going on. Is an ldap implementation the proper way to go for my desired solution or am I barking up the wrong tree? I've just now set up OpenDS on a VM for testing but I need to do some research there.
View 7 Replies
View Related
Mar 22, 2010
At work, using SambaKerberos and ActiveDirectoryWinbindHowto, I joined my machine to our ADS network. Again using ActiveDirectoryWinbindHowto, I modified both common-account and common-auth with these settings.
file: /etc/pam.d/common-account
account sufficient pam_winbind.so
account required pam_unix.so
file: /etc/pam.d/common-auth
[Code]....
According the the doc, when I first log in as a domain user, it should create the home directiroy /home/<whateverdomain>/<theusername>, but it doesn't.
View 2 Replies
View Related
Jun 5, 2010
Is there a way to encrypt existing home directories in lucid so that they will unlock with pam-encfs when the user logs in? Or must you do this when the directory is created?
View 1 Replies
View Related
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
May 26, 2011
I want to sync several directories between my laptop and desktop both at home and away from home. It seems like the tool to use for this is unison (I use rysnc for backups, but union seemed, better for this sort of thing - let me know if I'm wrong).
I found several posts that appear promising, however I was little confused about the details as I don't have much networking experience up to this point.
[URL]
1) Is a reverse ssh connection the way to go? If I only wanted to do this on my home network I could just use ssh right, however in order to get around the router outside my home network the reverse ssh is necessary?
2) How do I handle changing IP address of my laptop?
View 1 Replies
View Related
Jun 14, 2011
I'm trying to configure a per user samba login for full access to the user's home directory.Mounting the shared directory works flawless when mounting from Windows. I can read, write, create without problems. However, when mounting from Linux the shared space is readonly.
View 8 Replies
View Related
Jul 9, 2010
I work on machines with different architectures, all of which share the same home directory(what is the technical term for it -- network mounting ?). Since I don't have admin privileges on these systems, I have installed programs in /home/<my_id>/bin. A program compiled for one architecture doesn't work when I login into another system. I'm thinking of creating architecture specific directories which would contain inaries/libraries specific to that architecture and creating a softlink to it t /home/<my_id>/bin. The only problem with this solution is that I can't work on two systems at the same time.
View 1 Replies
View Related