Sponsored Content
Top Forums Shell Programming and Scripting Automatic su password entry script Post 302884212 by Corona688 on Saturday 18th of January 2014 12:20:55 PM
Old 01-18-2014
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 01:28 PM..
 

10 More Discussions You Might Find Interesting

1. Programming

/etc/shadow update password entry! ( getspent? )

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)
Discussion started by: nighter
2 Replies

2. Programming

userpw.h AIX ( delete entry from the shadow password database )

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)
Discussion started by: nighter
4 Replies

3. Shell Programming and Scripting

automating username / password entry

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)
Discussion started by: jbeck22
1 Replies

4. UNIX for Dummies Questions & Answers

Command to delay password entry - putty connection manager

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)
Discussion started by: skinnygav
1 Replies

5. UNIX for Dummies Questions & Answers

grep for password file entry

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)
Discussion started by: alis
7 Replies

6. UNIX Desktop Questions & Answers

How to grep for password file entry

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)
Discussion started by: alis
4 Replies

7. Shell Programming and Scripting

loop picks up password for 2 entry...how to avoid that ?

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)
Discussion started by: abdul.irfan2
5 Replies

8. HP-UX

Automatic script to change the UNIX Password

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)
Discussion started by: periyasamycse
6 Replies

9. How to Post in the The UNIX and Linux Forums

Help me, write a bash script to delete parent entry with all their child entry in LDAP UNIX server

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)
Discussion started by: Chand
1 Replies

10. Solaris

Set password in bash script without manual entry-Solaris 10

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)
Discussion started by: Jaffakeks
1 Replies
FMT(1)							      General Commands Manual							    FMT(1)

NAME
fmt, htmlfmt - simple text formatters SYNOPSIS
fmt [ option ... ] [ file ... ] htmlfmt [ -a ] [ -c charset ] [ -u url ] [ file ... ] DESCRIPTION
Fmt copies the given files (standard input by default) to its standard output, filling and indenting lines. The options are -l n Output line length is n, including indent (default 70). -w n A synonym for -l. -i n Indent n spaces (default 0). -j Do not join short lines: only fold long lines. Empty lines and initial white space in input lines are preserved. Empty lines are inserted between input files. Fmt is idempotent: it leaves already formatted text unchanged. Htmlfmt performs a similar service, but accepts as input text formatted with HTML tags. It accepts fmt's -l and -w flags and also: -a Normally htmlfmt suppresses the contents of form fields and anchors (URLs and image files); this flag causes it to print them, in square brackets. -c charset change the default character set from iso-8859-1 to charset. This is the character set assumed if there isn't one specified by the html itself in a <meta> directive. -u url Use url as the base URL for the document when displaying anchors; sets -a. SOURCE
/src/cmd/fmt.c /src/cmd/htmlfmt BUGS
Htmlfmt makes no attempt to render the two-dimensional geometry of tables; it just treats the table entries as plain, to-be-formatted text. FMT(1)
All times are GMT -4. The time now is 04:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy