Useradd with ansible


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Useradd with ansible
# 1  
Old 11-03-2017
Useradd with ansible

Hello,

I need ansible playbook to create new user on remote server. Remote server blocked direct root login so I must login first application user and later I must run "useradd" command with sudo.

I need playbook.yml and cli command.

Best regards,
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Ansible installation fails on standalone Oracle Linux

I have a standalone Oracle Linux server which has no connectivity to the internet. I was following a blog which directed me to download all ansible dependent setup files and install them using the below command. # yum localinstall -y python-crypto-2.6.1-1.el7.rf.x86_64.rpm... (7 Replies)
Discussion started by: mohtashims
7 Replies

2. UNIX and Linux Applications

Passing variables from UNIX to Ansible to UNIX shell

I m passing a variable stringg from Unix shell which has value 'Good Day' to ansible and from ansible to a second shell script where it print only Good instead of 'Good Day' passing the variable stringg from unix shell script1.sh echo $stringg ansible-playbook install.yml -i... (1 Reply)
Discussion started by: mohtashims
1 Replies

3. UNIX and Linux Applications

Ansible Automation

Hi Gurus, I am new to ansible automation, kindly suggest me whether i am going in right path. I Want to automate deployment of apache,mysql-server on multiple Linux hosts. ansible version i am using ansible 1.5.4 OS: Ubuntu 14.04.5 LTS below is the Script created for the same --- -... (3 Replies)
Discussion started by: venky.b5
3 Replies

4. Solaris

useradd

I want to creat a 27 logins in solaris.Can anyone tell me how to write a script for that so that i create at a time for all 27 people. Thanks to guide me. (6 Replies)
Discussion started by: kkalyan
6 Replies

5. Solaris

useradd

if useradd command is deleted in solaris how do we add user (3 Replies)
Discussion started by: vivek_ng
3 Replies

6. UNIX for Advanced & Expert Users

useradd?

Hi Experts, when using useradd command, what are the necessary options/arguments to be included? Please advice. (4 Replies)
Discussion started by: etcpasswd
4 Replies

7. Shell Programming and Scripting

useradd

Gurus, I need to add a user to all the machines. I need a script to do this. I did one but it does not allow me to su to root within a ssh session i open. It exists saying su: Sorry. Please let me know how i can do it. I do not have the freedom of using sudo either. Regards (4 Replies)
Discussion started by: earlysame55
4 Replies

8. Solaris

useradd

Hi, I need to add a new user who will only be able to access one single folder on my Solaris 9 system. Can this be achieved by using just useradd or do i need to fiddle with auth_attr table? TIA, Selma (4 Replies)
Discussion started by: Selma
4 Replies

9. UNIX for Advanced & Expert Users

useradd

Hi. due to some needs i gave a user the premission to use useradd command with sudo. i want to know if there is a way to let him set the initial password, without giving him the premission to use passwd command as root (sudo). maybe a way to set a default password for all the new users that... (2 Replies)
Discussion started by: dorilevy
2 Replies

10. UNIX for Dummies Questions & Answers

useradd

I work on some hp ux 11.00 Servers. i have to add an user. i use the useradd command like follows: useradd -u 72022 -g 71095 -c " comment " -d /PACKAGE_NAME/home/username -s /usr/bin/sh username The command returns with error 3. The manpage means value number 3: Invalid argument supplied to an... (6 Replies)
Discussion started by: ortsvorsteher
6 Replies
Login or Register to Ask a Question
chsh(1) 						      General Commands Manual							   chsh(1)

NAME
chsh - change default login shell SYNOPSIS
login-name [shell] login-name [shell] login-name [shell] login-name [shell] DESCRIPTION
The command changes the login-shell for a user's login name in the repository (see passwd(1)). The DCE repository is only available if Integrated Login has been configured; see auth.adm(1M). If Integrated Login has been configured, other considerations apply. A user with appropriate DCE privileges is capable of modifying a user's shell; this is not dependent upon superuser privileges. If the repository is not specified (as in [login-name]), the login shell is changed in the file only. Run after running to make sure the information was processed correctly. Notes The command is a hard link to the command. When is executed, actually the command gets executed with appropriate arguments to change the user login shell in the repository specified in command line. If no repository is specified, the login shell is changed in the file. Arguments login-name A login name of a user. shell The absolute path name of a shell. If the file exists, the new login shell must be listed in that file. Otherwise, you can specify one of the standard shells listed in the getusershell(3C) manual entry. If shell is omitted, it defaults to the POSIX shell, Options The following option is recognized: Specify the repository to which the operation is to be applied. Supported repositories include and Security Restrictions You must have appropriate privileges to use the optional login-name argument to change another user's login shell. NETWORKING FEATURES
NFS File can be implemented as a Network Information Service (NIS) database. EXAMPLES
To change the login shell for user to the default: To change the login shell for user to the C shell: To change the login shell for user to the Korn shell in the DCE registry: WARNINGS
If two or more users try to write the file at the same time, a passwd locking mechanism was devised. If this locking fails after subse- quent retrying, terminates. AUTHOR
was developed by HP and the University of California, Berkeley. FILES
SEE ALSO
chfn(1), csh(1), ksh(1), passwd(1), sh(1), sh-posix(1), getusershell(3C), pam(3), passwd(4), shells(4). chsh(1)