I just wrote a bash script to create users remotely from a file.
When I run the script localy, it work nice.
But when I run it using rsh it stops.
My script is:
1, read a file | and while read each line do
2, run adduser command for each $line variable content
3, run echo for the content of $Line variable + 123 and sent it to standar input of passwd command when ask for the username ($Line variable content)
4, and finally show a Message, "User's password changed"
If I run localy it works perfect.
When I put it together with rsh it fails.
I really appreciate your help if you can help me to fix this bad script definition.
Last edited by Scrutinizer; 02-08-2013 at 12:23 PM..
Reason: quote tags -> code tags
Did you look at the error message? It cannot find ./root/SCRIPTS/Hosts/serv.txt. So that file does not get loaded,
There should be a space between . and /root
Hello,
I have problem to write script which can collect users "username" and the time that each user has been created in our machine and store these data in file database.txt
I have searched a lot and found we can see the exact time we create user with:passwd -S username also list user will... (3 Replies)
hi,
i am new to shell scripts
i write a shell script to create multiple users but i need to give passwords to that users while creating users, command to write this script (1 Reply)
* Can we create multiple users with same UID?
* Can we give root permissions to normal user like admin.s ? If YES give me full details (syntax of sudo/RBAC) (14 Replies)
I'm trying to write a script that in the end will from one central location hop to a bunch of servers and then run a series of ping tests. The thing is, the list of devices that needs to be pinged is going to be different for each server. So what I want to do is be able to do is read through the... (0 Replies)
I volunteer with a small charity which locally donates refurbished computers to people who normally could not afford their own computer. Most of these computers now have Linux on them. We are in the process of remastering Xubuntu 9.04 to use as our main distro from now on.
In the past any time... (3 Replies)
Hi Friends,,
I installed solaris 10 in vmware just now.I got a simple problem while i want to create users in /home directory.It is saying "cannot create ".So i checked the permission and then i find that the perm to user(root) is r-x.So i tried to change it to rwx using chmod but again i got a... (4 Replies)
I new to unix and I'm using a HP UX and I'm logging in as user: root. I wish to create new users by using the 'useradd' command.
When I keyed in' useradd -u 101 -g group john', the reply was 'Group group specified with -g does not exist'.
I've read the man page on useradd and I still don't... (8 Replies)