Server :: Useradd & Smbpasswd Using Shell Script?
Apr 5, 2011how to useradd & smbpasswd using shell script.The below script i tried but its not working.
echo "$ecare2@" | smbpasswd -as "$ramecare"
how to useradd & smbpasswd using shell script.The below script i tried but its not working.
echo "$ecare2@" | smbpasswd -as "$ramecare"
is it possible to create a shell script that adds user and password in the passwd and smbpasswd?
View 3 Replies View Relateddo you guys know how to add a user to a linux box without using useradd?I'm working on a project to disect the process of adding users, but can't use useradd command.I know this involves modifying couple of files such as /etc/passwd, /etc/groups, etc..but i'm sure there is more to it.
View 3 Replies View RelatedI want to add a user with useradd command, however I get this error:
Code:
mahmood@node1:home$ sudo useradd user2
useradd: cannot lock /etc/passwd; try again later.
When I try to run smbpasswd this is what I get:
cli_pipe_validate_current_pdu: RPC fault code DCERPC_FAULT_OP_RNG_ERROR received from host 127.0.0.1!
machine 127.0.0.1 rejected the password change: Error was : NT code 0x1c010002.
I'm using samba4. To use smbpasswd I just typed "smbpasswd" and pressed enter. There are no other machines involved. I have virtual machines in my system which I am trying to get to accesss files on this computer, but I don't think that counts.
I am using Slackware 13.1 with the uname -a output:
Quote:
Linux darkstar 2.6.33.4 #2 Thu May 13 00:27:45 CDT 2010 i686 Intel(R) Atom(TM) CPU N450 @ 1.66GHz GenuineIntel GNU/Linux
When the binary smbpasswd is executed it gives the following output
Quote:
smbpasswd: error while loading shared libraries: libwbclient.so.0: cannot open shared object file: no such file or directory ldd /usr/local/samba/bin/smbpasswd has this output
Quote:
linux-gate.so.1 => (0xffffe000)
libldap-2.4.so.2 => /usr/lib/libldap-2.4.so.2 (0xb7220000)
liblber-2.4.so.2 => /usr/lib/liblber-2.4.so.2 (0xb7214000)
libresolv.so.2 => /lib/libresolv.so.2 (0xb71fd000)
[code]....
I do not know how to direct the binary to the missing library.
I am using ubuntu10.04-server 64bit AMD with fluxbox. After I ran Matlab in a shell (without GUI) the shell does not display characters anymore, but will execute any command, I just can't see the characters that I'm typing.. I use aterm and xterm, does anybody know why that is, am I missing a package?
View 1 Replies View RelatedHow can I add user on LDAP to my Linux server ?
View 1 Replies View RelatedI am trying to learn shell scripting from a book and all I am doing is following few instruction from the book. Now this is what I am doing. I am trying to add a user using the useradd command so I run the following at command prompt root@S8500C_9>useradd ajit. The first time when I add this user I was successful.Later I deleted this suer using the userdel -r ajit command.Now when again I am trying to add this user it gives me following error. useradd: group ajit exists - if you want to add this user to that group, use -g. Now when I try using the -g option with the useradd command it gives we all the set off options avaiable to use along with the useradd command but doesnt create the ajit use
View 5 Replies View Relatedwhen i see /usr/bin there is no useradd command. and i want to add a user.if i type the command it is shooting an error saying command nt found .how should i create a user.
View 3 Replies View RelatedCode:
useradd -u 8001 -g luc -p mypassword -s /usr/bin/bash -d /home/luc luc
Open another terminal:
Code:
luc[159-0]test> ssh luc@61.62.63.64
[Code].....
Jump back to the other terminal... Try SSH login... Success!
'adduser' works, 'useradd' doesn't. Why? I have read the man pages several times and can't find the error in my command line.
I have a similar problem with groupadd
This fails: groupadd -g 8001 staff
This works: groupadd staff
getting a error return code for useradd commandthe return code is 1cite or tell me the explanation of return code 1 .
View 1 Replies View RelatedI encountered a question in the Redhat Skills Assessment regarding useradd: Which of the following cannot be defined when you create a user account with useradd?
a* A password expiration date.
b* The user's primary group.
c* The user's default shell.
d* The user's NIS or LDAP group.
e* The user's home directory.
Which is the correct answer? I have my own thinking which will be explained later.
I created a new user with command useradd (as root) :
Code: Select alluseradd razer123
And then set a password with command passwd (as root):
Code: Select allpasswd razer123
No Error!
When I logged out and tried to login with new user, I coulden't! (even after restart!)
I looked into /etc/passwd :
Code: Select allcat /etc/passwd | grep razer123
result:
Code: Select allrazer123:x:1002:1002::/home/razer123:/bin/bash
There is no home folder in the path!
# I have debian 8 and MATE desktop.
I want to create one user without password using useradd command. Is there any way we can do the same? I have googled it but couldn't get the perfect solution
View 1 Replies View RelatedProftpd is installed and running fine on 8.04 server. I want to streamline the process of adding users. Adding a ftp user with USERADD fails (user is created but connection fails when trying to connect with ftp client).
Code:
useradd -d /ftp/ftphome/myuser -g ftp -m -p mypassword -s /usr/sbin/nologin myuser
But, ADDUSER works:
Code:
adduser myuser
usermod -d /ftp/ftphome/myuser -g ftp -m -p mypassword -s /usr/sbin/nologin myuser
It's a bother because I want to automate the process, and ADDUSER has all those prompts and asks for the password twice.
I would like to add a new user with useradd (on Debian 4.0), I get the message Segmentation fault. I made a strace, that says: access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) I have read maybe the libc6 is missing or damaged, so I installed it again (apt-get install libc6, install was successfull), but the problem is still there. I touched it (touch /etc/ld.so.nohwcap)
View 7 Replies View RelatedI work under centos 5, I would like to know which command to use in order to find where the useradd command is geinstalled. Second How can I find the 10 last files sorted (reverse) from the /etc directory.
View 2 Replies View RelatedI try to add a new user but got error (shown in title). Is it possible to create a new user and create a new group at the same time? Or should I create the new group first then the new user?
View 1 Replies View RelatedI am bulding my own image based on 2.6.32 kernel, I wish to add a guest user:
In a script thats invoked by the makefile, I use 'useradd' command & this updates the shadow, passwd files under /etc on the host, is it possible to tell the command to create the shadow / password under some other folder on the host? may be /tmp?
when I try to add a user it fails to make the corresponding home directory. I can still su to the user, set the password, and everything else. the output is as follows:
$ useradd username
useradd: cannot create home directory /home/username
I read that this could be a result of there not being enough space but if I do df -h, i see that only 88% of the memory is being used.
Quote:
/usr/local/bin/mencoder /root/video1.avi -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=300:acodec=libfaac:abitrate=64 -srate 22050 -oac lavc -vf scale=360:240 -o /root/output_temp_video1.flv
[code]....
I have to have a Linux server for shell programming on Windows (XP) clients
View 3 Replies View RelatedIs there a way to run CentOS 5.2 update system using the shell, avoiding the GUI (I want to do it remotely using SSH?
View 1 Replies View RelatedHow do i configure the system and user accounts so that the users can't access each others directories, delete system files, install packages etc.I know i am probably going to need tools like chmod mkdir useradd.But i can't figure out how.If you know a good tutorial, please point me in that direction.
View 3 Replies View RelatedI have installed a puppet server and its client on Centos.Puppet server and its client is running fine and its update whatever changes made on Puppet server is updatedon its client but i am unable to execute script (Bash shell)on the client through Puppet server. So please advice a suitable class or parameter for Puppet server so that it could execute on its client
View 3 Replies View RelatedI'm new to linux and try to make a ubuntu home server.1.One of my concerns is that i can't figure out how to use bittorrent (or any other torrent download application) from shell. (i have the desktop package installed but i don't wanne get used with that - or should i start the downloads from there but if I close the gdm (gdm stop) will my bittorrent stop as well?)
View 9 Replies View RelatedI need a to allow a user to tunnel an ssh session but disallow them a bash shell. # chsh -s /sbin/nologin {username} won't cut it...? would permissions be the way to go with it? But how? Setup a group and add the user to that group? Or add all other users to that group... I'm confused
View 3 Replies View RelatedI have 2 servers, let say server1 and server2. I have create ssh-keygen from server1 to server2, I can ssh from server1 to server2 without typing a password. My question is: How can I use command from server1 to server2? for example I want to list file in server2 /home directory from server1.
View 1 Replies View RelatedWe've converted several older unix servers from HP UX to VM's running RHEL 5.The database applications and everything else run great, however we have a group of programmers who need to be able to use character based, wyse60 sessions using tiny term. I'm having trouble making the cool elements in bash work in this emulator, and even more trouble simply replicating what was available in the /sbin/sh used in HP UX?
View 1 Replies View Related