1) Yes I know it's bad practice and obomination to all things holy, but I'm not a sys admin at JP Morgan, I'm a hobbyist tooling about in a VM, in my pants, at home.
2) If you are just going to flame for even considering hardcoding a root password, thanks, I get it.
So here goes.
I have the following script:
It works fine in that it enters the password and elevates the privileges of the user.
The problem is that it then exits at the marked point and does not continue to the code below.
Any ideas why this is?
Running Backbox 64 Bit in VMPlayer
Last edited by 3therk1ll; 01-18-2014 at 11:47 AM..
Reason: Forgot system details
su doesn't change the user of your shell, it runs a new shell, reading from standard input. If you want it to run any particular text you'll have to feed that text into it, it won't automatically read lines from some other shell.
If this is your own hobby machine, you can install sudo and enable it for everyone in the wheel group with the NOPASSWD option. Using expect when you don't have to is like this.
Last edited by Corona688; 01-18-2014 at 02:28 PM..
Hi
I have a root script which is setting up user and his dirs and so on. After I create user and set up all the necessary I have to manually set user password. I try all possible ways what google find me and nothing works for me. If maybe one of you have a solution for my problem it will be... (1 Reply)
Hi All,
Please help me and guide me to write a bash/shell script on Linux box to delete parent entry with all their child entries.
example:
Parent is :
----------
dn: email=yogesh.kumar@wipro.com, o=wipro, o=in
child is:
----------
dn: cn: yogesh kumar, email=yogesh.kumar@wipro.com,... (1 Reply)
Hi,
we have around 50 users and every month we need to change the password manually once its expire.
do we have any script to change the password automatically.
OS -HP-UX
Thanks in advance.. (6 Replies)
hello all, i am trying to find a better to do what i am doing right now...
i have a file called sidlist...which has my database_name and password to the respective database
so something like below.. file is called sidlist and entry is below...
test, abc123
kes12, abcd12
pss, abcd1234... (5 Replies)
How would I grep for password file entry without using
grep 'username' /etc/passwd?
perhaps with who?
I want to create alias that will find the password file entry regardless of the user who is using it.
Thanks (4 Replies)
How would I grep for password file entry without using
grep 'username' /etc/passwd?
perhaps with who?
I want to create alias that will find the password file entry regardless of the user who is using it.
I am trying to get the same exact line from the file entry like:
Name : Password : UserID... (7 Replies)
Hi all,
putty connection manager is great but when attempting to sudo or ssh to another box via the post login commands it is subject to issues due to network latency (what happens is that pcm enters the password before the unix box is ready to receive it). Is there any clever way I can make... (1 Reply)
I have a database that contains a list of server names, and the password for the root user on several servers (100+). I need to verify the passwords for each of the servers in an automated fashion because the database continues to grow. All of the users that I'm going to test are ROOT. I can't... (1 Reply)
HI i need to delete an entry in /etc/security/passwd.
can't find a way to do it with userpw.h api ( AIX ).
the passwd file i delete like this.
Write all entrys to passwd file except the one we are removing.
can't find any function that works like getspent / getpwent do
in AIX userpw api.... (4 Replies)
Hi i just whant to update an password entry in /etc/shadow.
But dosen't get it to work. Something is wrong! in this code.
What i try do do is if user kalle exist in shadow.
I whant it to update it's password for just that entry.
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>... (2 Replies)