Sponsored Content
Top Forums Shell Programming and Scripting solaris create password in a script and continue Post 302721717 by jim mcnamara on Thursday 25th of October 2012 04:35:41 PM
Old 10-25-2012
Actually, on Solaris, see Rich Teer's 'Solaris System Programming' and chapter 23 on pty's. If you want to understand what you have to do to get scripted passwords
into the passwd program. truss will not help that much. Get a copy of the book, Chapter 23 on pty's, pp. 1011-1016, and copy and compile the pty code. You can use this to automate passwords.

There is a reason NOT to use expect. Or pty. Putting passwords in a file is a really bad idea. So the folks who wrote passwd made it difficult to change or create passwords using a script. And I do not know if there is expect for Solaris.
 

9 More Discussions You Might Find Interesting

1. Solaris

How to create a simple background script on Solaris

I have a local account for a unix server. The idle timeout for the account is around 10 mins. I have to login to the server multiple times during the day. Is there a way to increase the idle timeout or may be a script that I can run on background so it is not idle. Something like echo date every 9... (3 Replies)
Discussion started by: vinaysa
3 Replies

2. Shell Programming and Scripting

Create new user account and password in shell script

I am trying to create a shell script that will: check if a specific user already exists if not, create a specific group and create the user in that group assign a password to that user, where the password is passed in as a parameter to the script The problem that I need help with is 3 on... (4 Replies)
Discussion started by: killuane
4 Replies

3. Shell Programming and Scripting

Create script for change root password via SSH

HI I 'm new shall script and unix. I want to create script for change password root by ssh-keygen command . I have 50 servers and I want ot login ot the servers via ssh by type ones password and can login every machines.The script ssh-keygen must ot generate key every weekly than it send new... (2 Replies)
Discussion started by: pellnapook
2 Replies

4. Shell Programming and Scripting

script to create files on solaris 10

Hello, To learn ZFS, i try to create pool . and for that i want create 10 files with 512MB (because i dont have multiple disks and multiple controllers) ADMIT THAT THIS IS TEN HIGH-PERFORMANCE HARD DRIVES To get this 10 files,all of them have the same size : 512MB, I do these... (0 Replies)
Discussion started by: herbich1985
0 Replies

5. UNIX for Advanced & Expert Users

Can we Automate the User creation and setting password through a script in solaris 10

Hi, I am using Solaris 10 OS and Bash shell.Is there any way can we automate User creation and setting passwords through a script or any freeware tool. Advance thanks for your response. (1 Reply)
Discussion started by: muraliinfy04
1 Replies

6. Shell Programming and Scripting

solaris create password in a script and continue

Below is my code to create a user account but it doesn't take a password automatically. I have to run the password command seperately to do this What I want to do is to be able to accept the password in a script. In linux with the "useradd' command you can give the "-p" flag to accept the... (1 Reply)
Discussion started by: slufoot80
1 Replies

7. Shell Programming and Scripting

solaris create password in a script and continue

:eek:Below is my code to create a user account but it doesn't take a password automatically. I have to run the password command seperately to do this What I want to do is to be able to accept the password in a script. In linux with the "useradd' command you can give the "-p" flag to accept the... (1 Reply)
Discussion started by: slufoot80
1 Replies

8. UNIX for Advanced & Expert Users

Need a exit from sftp if its ask for password and continue to run remaining part of script.

Hi I am checking status of sftp in Health check script, sftp command is used to connect the server with secure RSA key, which is successfully get connected most of the time but in some case if RSA key ask for password then I need to exit sftp command after few second and continue to run... (1 Reply)
Discussion started by: ketanraut
1 Replies

9. 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
UNLOCKPT(3)						     Linux Programmer's Manual						       UNLOCKPT(3)

NAME
unlockpt - unlock a pseudo-terminal master/slave pair SYNOPSIS
#define _XOPEN_SOURCE #include <stdlib.h> int unlockpt(int fd); DESCRIPTION
The unlockpt() function unlocks the slave pseudo-terminal device (pty) corresponding to the master pty referred to by fd. unlockpt() should be called before opening the slave side of a pty. RETURN VALUE
When successful, unlockpt() returns 0. Otherwise, it returns -1 and sets errno appropriately. ERRORS
EBADF The fd argument is not a file descriptor open for writing. EINVAL The fd argument is not associated with a master pty. VERSIONS
unlockpt() is provided in glibc since version 2.1. CONFORMING TO
POSIX.1-2001. SEE ALSO
grantpt(3), posix_openpt(3), ptsname(3), pts(4), feature_test_macros(7), pty(7) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2008-06-14 UNLOCKPT(3)
All times are GMT -4. The time now is 02:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy