Programming :: Inserting Usr Into /etc/passwd Via Script?
Jan 19, 2011
I need to either locate a script that is similar to what I am needing or figure out a better way of doing what I need. I have mutiple shops with AIX unix servers, using ksh with virtual terminals that connect. since these are on an internal network we have them connecting to the server as either usr01, usr02, etc. what I need to do is add 15 user's ranging from usr01-usr15 into /etc/passwd each usr is identical in such that each line contains
Code:
usr01::0:0::/usr/tops:/bin/ksh
only difference is the usr# changes. I wrote a script where I was just adding these all to the /etc/passwd but now I have been tasked with adding them to these shops but with out any duplicates. is there any way to have a script check the file to see if the usr# exists and if so proceed to the next number and then input the usr#::0:0::/usr/tops:/bin/ksh into the file?
View 7 Replies
ADVERTISEMENT
Jan 14, 2011
we know that /etc/passwd - is a replica of /etc/passwd file and acts as a backup in any damage done to /etc/passwd file..i have observed a strange thing in RHEL 5.4....for example... if /etc/passwd has 100 accounts.. then /etc/passwd - is having only 99 accounts....when i add 101 useraccount with "useradd" then /etc/passwd has 101 accounts and /etc/passwd is having the 100th account of /etc/passwd - ..when i delete /etc/passwd and recover it with /etc/passwd - from runlevel 1 the lastly created user is not having his account after recovery.. what is the solution? this is same case even with /etc/shadow and /etc/shadow -
View 2 Replies
View Related
Mar 8, 2009
I need to replace part of a line in a file with multiple lines, however need to separate each line with a newline is this possible?
Example, need to remove line 2
And insert line similar to below:
If the multiple lines were part of a text file, would inserting a text file automatically include newline characters?
View 1 Replies
View Related
Oct 20, 2010
I'm gonna replace my machine's ip address and hostname using awk command. the pattern of the file is like the following...ip address="192.168.1.100"the script must ask the ip address from the user and replace it with the ip address in the quotation.
View 14 Replies
View Related
Aug 26, 2010
I'm writing a C program, and using Autotools. I have a large text file that I need to include verbatim, as data for my program.I used to have a hacked-together Perl script that would take a file like this: Code: A Rabbi, a Priest, and a Minister walked into a bar.The bartender said, "What is this, a joke?" I found this site that contains instructions for doing exactly what I want, but that technique requires GNU's ld, and the whole point of using Autotools in the first place is to make my project platform- and compiler-independent.I should point out that, according to the Autotools help, I can do this with a script called either "txtc.sh" or "txtc.sh.in". Unfortunately, Google can't find such a script, and it's not in any package that I can find.
View 12 Replies
View Related
Jun 23, 2010
alright, i have a LFS script and im pretty sure i know how to use it correctly, the only big iff i have with it up where it says WGETLIST="" should i insert the website where all the packages are contained? and the same would be assumed for the MD5 checks as well.im just a little lost as to what should go in between the quotes.
View 1 Replies
View Related
Apr 6, 2010
creating a script which evaluates whether or not the passwd file has changed.
View 4 Replies
View Related
Aug 5, 2010
What is the easiest way to replace a hash in a shadow file for one particular user, not using passwd, and when the current password is unknown?
View 3 Replies
View Related
Jan 16, 2010
insmod: error inserting 'kernel.ko': -1 Invalid parametersI am getting this error when i am try to insert kernel.ko into kernelMy systemfedora 12 with gcc 4.4.2insmod kernel.koinsmod: error inserting 'kernel.ko': -1 Invalid parametersmy program
__________________kernel.c________________________ ___________
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
[code].....
View 4 Replies
View Related
Feb 12, 2010
I want the below line of text to be inserted in a file.Description "Linux Group" $1i am using sed "10 iDESCRIPTION "Linux Group" $1" filenamebut because of the "Linux Group" my code goes into infinite loop.Please let me know how i need to print Linux group with the double quotes in my file.
View 4 Replies
View Related
May 17, 2011
Title is self explanatory.
Is there any way i can accomplish this?
View 1 Replies
View Related
Nov 4, 2010
If I try and paste text from the clipboard when using vim, it automatically inserts hash at the start of every line. This is driving me mad! How to I get rid of it? Ive deleted all my .vim files/directories in my home directory.
View 3 Replies
View Related
May 20, 2010
Well we all know that it holds passwords. But cat-ing it gives out nothing. Not even encrypted gibberish. So how exactly is a password stored in this? Is this like a device file or something?
View 4 Replies
View Related
Jan 5, 2010
If I configure a crontab like below.12 3 12 4 4 cat /etc/passwd I know that the cat command will get executed at the configured time. But where will the output of that command go?If it is something like below, then out put will be routed to /tmp/file1.12 3 12 4 4 cat /etc/passwd > /tmp/file1
View 4 Replies
View Related
Jul 6, 2011
When I insert any USB device (flash drive, bluetooth device, Nokia USB data cable), my system goes in suspend mode (standby). Same thing happens when I remove the device. I have to wake up the computer by pressing a key or the power button. By the way, I don't think this ever happened in the first 3 or 4 days of installing Natty.
View 1 Replies
View Related
Apr 18, 2010
While I'm inserting a CD in the drive it is not playing.
View 5 Replies
View Related
Jan 31, 2011
I am having a problem while inserting a particular module.
Following are some prints :-
I am using STLinux-2.4 Distribution, kernel 2.6
I have changed the access permissions on all the .ko as rwx. Still I am getting the problem.
View 2 Replies
View Related
Jun 5, 2011
What command is executed when you plug in a USB Flash drive manually in the PC's USB port?I am pluggin in the device and it is automatically getting mounted in /media/ed7a753f-df88-4984-b65a-5d3a8cc2714a. After I unmount the device using umount /media/ed7a753f-df88-4984-b65a-5d3a8cc2714a, how do I remount it from the terminal so that the weird directory gets created automatically and the Flash Drive gets mounted there?Another question, where does the system get this ed7a753f-df88-4984-b65a-5d3a8cc2714a. Is it some kind of identification of the disk?
View 6 Replies
View Related
Aug 2, 2011
I am having problem in adding a word in same place on different line in vi editor (/bin/bash).
View 4 Replies
View Related
Mar 1, 2010
this is my sed script
#
# insert the line '-A INPUT -i eth0 -j ACCEPT'
# in iptables
#
/-A INPUT -i eth0 -j ACCEPT/a
-A INPUT -i edge0 -j ACCEPT
but when i run sed -f script iptables. it just echo's it to the the screen with my line added and not into the actual file. anyone know what i am doing wrong?
View 4 Replies
View Related
Feb 23, 2010
I know that Apache creates as many instances of a CGI program as required but I have no idea how those instances write to the same file in an orderly manner.For example, a CGI program called by Apache inserts additional data in a file, is that file made automatically unavailable to the other instances (children) of this CGI program while it is inserting the data? Or should the CGI program do that?
View 2 Replies
View Related
Mar 24, 2011
I am running Red Hat with 2.6.18-194.8.1.el5PAE kernel version. I am trying to run encryptfs to encrypt a partition on my hard drive. One of the kernel modules necessary is the md5.ko. I noticed it wasn't loaded in when doing an lsmod. I tried running modprobe md5 and it fails to load:
[root@ ~]# /sbin/modprobe -v md5
insmod /lib/modules/2.6.18-194.8.1.el5PAE/kernel/crypto/md5.ko
FATAL: Error inserting md5 (/lib/modules/2.6.18-194.8.1.el5PAE/kernel/crypto/md5.ko): Invalid argument
I ran dmesg and grepped for md5, but I didn't see anything in there.
View 1 Replies
View Related
Sep 18, 2010
I was doing some experiment about resource-accessing. By mistake, I executed this command,$ sudo mv /etc/passwd /etc/passwd.bakThen I could not execute any command with privilege(eg. sudo mv /etc/passwd.bak /etc/passwd). When I shut the system down, I could not boot it any more.
View 2 Replies
View Related
Sep 29, 2010
I have an account on a remote Ubuntu machine. I started the vncserver on that box, it used display number 7. From my Windows machine, I connected to the remote box on port 5907. It connected, but said, "no password configured for vncauth". I noticed that the ~/.vnc/passwd file is empty, alongwith the log file. I typed vncpasswd to set the password again, but no use. I tried vncpasswd ~/.vnc/passwd as well, but no use.The VNC server is running.
View 1 Replies
View Related
Mar 25, 2010
/etc/passwd permissions keep getting reset to 600. When I set it to 644 as su, it eventually changes back.This occurs on my openSuse10.2 machine but not the openSuse 11.1 machine, but I assume that is irrelevant. Is there something that got tweaked that I need to change in Yast to stop this from happening?
View 5 Replies
View Related
Dec 20, 2010
All servers mentioned below run OpenSuSE, either 10 or 11.I am currently working on a few scripts that are meant to be used as part of a continuous integration setup. I am trying to keep these scripts reasonably secure, and so I have made sure that all the servers run these scripts only as a specific user (user1) that has permissions to basically nothing else. The problem I am currently running into is that I need to start and stop tomcat as user1 but this user doesn't have permissions to the tomcat rectory (only tomcat has execute permissions). I have a temporary workaround in place while I work on the scripts (I have an SSH key in place that allows me to SSH from user1o tomcat without a password and execute my commands that way) but it is not very secure. I have tried adding the following line to /etc/sudoers:
Code:
tomcat localhost = NOPASSWD: /opt/tomcat/bin/startup.sh, /opt/tomcat/bin/shutdown.sh
but it doesn't work as I expected it to. I tried a few different syntaxes for that line,
[code]...
View 6 Replies
View Related
Aug 10, 2010
I got a user account on a linux network. But when I look in the /etc/passwd file, I don't see my username there. Where would I find my username
View 3 Replies
View Related
Apr 11, 2010
Unfortunately i lost my passwd file...so who to recover that.
View 8 Replies
View Related
Jun 25, 2011
I'm running a small network of 20 PC's (slackware), I had previously used NIS and can't really be bothered with ldap it's a bit of hassle. I do not need a centralised database just a login auth system.On the server I make a folder called /sec and symlink passwd, group and shadow into it.I export this via nfs.On the workstation I create a folder /sec, move the passwd, group and shadow file into it and then symlink them back into the /etc folder.On bootup, the rc.local mounts server /sec over the top of workstation /sec. If it fails it falls back.I wasn't sure if I could just mount /sec on the workstation and then temporarily symlink group,passwd,shadow over the top of the /etc/shadow etc
View 4 Replies
View Related
Jul 28, 2010
In what cases would a user appear in /etc/shadow and not /etc/passwd
View 2 Replies
View Related