Sponsored Content
Full Discussion: creating a new user
Top Forums UNIX for Dummies Questions & Answers creating a new user Post 25289 by binhnx2000 on Saturday 27th of July 2002 09:51:36 AM
Old 07-27-2002
Hammer & Screwdriver

Login as root.

Use command adduser

root@localhost#: adduser test

root@localhost#Smilieasswd pass_for_test

root@localhost#:mkdir /home/test

root@localhost#:chown test /home/test

root@localhost#:chmod 755 /home/test
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

creating user accounts in AIX

Hello all: I am new to UNIX and I am given the responsibility of administering a UNIX machine recently. The system is a IBM AIX 3.1. As a part of my duties I recently created some user accounts using "smit". It looked as if everything went well. But, after creating the account, I logged into... (3 Replies)
Discussion started by: pdepa
3 Replies

2. UNIX for Dummies Questions & Answers

creating a new user

I have AIX 5.1 I have created a user manually in the /etc directory. Then I created his home directory "mkdir /home/fharvey" then I changed ownership "chown fharvey /home/fharvey" set his password "passwd fharvey" When I log in as him I get "user is required to change password. "when I... (7 Replies)
Discussion started by: rocker40
7 Replies

3. AIX

Limiting length of user in while creating user

Hi all, I am a newbe to aix 5.2. I want to specify the characters used by users while creating user in aix like specifying the length of the password should i use some sript for that if it is then please let me know how to do this if yes give me the link for the scripts. Thanks in advance ... (2 Replies)
Discussion started by: Satya Mishra
2 Replies

4. UNIX for Dummies Questions & Answers

Creating user accounts

Hey everyone I am new to the forums and to Unix. I am currently taking a class on Unix, our teacher posed the question to us How do u create a user account without using GUI or command? We are currently running Knoppix version of Unix and for the life of me I can't figure out how this is possible.... (0 Replies)
Discussion started by: Redditt90kg
0 Replies

5. Shell Programming and Scripting

Creating user accounts

Hi, I have written a program using shell scripting. When you run the file it will asks you to enter the user name, if the user exists it says " user exists " if not it will displays like " user doesnt exist" and then asks you like " do you want to add user with options Yes or No " if you say... (1 Reply)
Discussion started by: vishwaprasad
1 Replies

6. Solaris

Creating user in solaris

Hi all, I logged in as root in solaris machine and made an attempt to create a user ,i am getting the following error message pls help me to resolve this issue bash-3.00# useradd -d /home/kalyan -m -s /bin/sh kalyan UX: useradd: ERROR: Unable to create the home directory: Operation not... (2 Replies)
Discussion started by: kalyankalyan
2 Replies

7. SuSE

creating user on SUSE Linux

Hi I need to create a user who can have access on only one folder. for example I created a user "test" . he should have access only on folder /testfolder. The problem is that the user will mostly use FileZilla to ftp his files in the testfolder. In the fileZilla , i want him to be... (21 Replies)
Discussion started by: SystemEng
21 Replies

8. UNIX for Dummies Questions & Answers

Creating files with New User

Hello All, I just created a new user on a server running SLES 11, and I created the user using the command below: # useradd -G nagios scpuser But whenever I create a file or directory while logged in as this user it creates the file's ownership permissions as "scpuser:users" instead of it... (2 Replies)
Discussion started by: mrm5102
2 Replies

9. UNIX for Dummies Questions & Answers

Creating a new directory by getting input from user

Hi All, I am really new to Linux.I am trying to write a script for creating a new directory by getting input of folder name from the user.Please help me in this regard. #! /bin/bash echo "Enter name of dir":$filename mkdir -p $filename When executing this I am getting following error ... (13 Replies)
Discussion started by: Pradeep_1990
13 Replies

10. UNIX for Advanced & Expert Users

Prevent user from creating new user from his login

Hi Experts, Need your support Redhat 6.5 I want to create a user with all(read, write, execute) privileges except that user should not be able to create any new user from his login to perform any task. (10 Replies)
Discussion started by: as7951
10 Replies
EXAMPLES-WITH-PDO_4D(3) 						 1						   EXAMPLES-WITH-PDO_4D(3)

Examples with PDO_4D - Examples PDO_4D

	This basic example show how to connect, execute a query, read data and disconnect from a 4D SQL server.

       Example #1

	      Basic example with PDO_4D

	      <?php
	      $dsn = '4D:host=localhost;charset=UTF-8';
	      $user = 'test';
	      $pass = 'test';

	      // Connection to the 4D SQL server
	      $db = new PDO($dsn, $user, $pass);

	      try {
		  $db->exec('CREATE TABLE test(id varCHAR(1) NOT NULL, val VARCHAR(10))');
	      } catch (PDOException $e) {
		  die("Erreur 4D : " . $e->getMessage());
	      }

	      $db->exec("INSERT INTO test VALUES('A', 'B')");
	      $db->exec("INSERT INTO test VALUES('C', 'D')");
	      $db->exec("INSERT INTO test VALUES('E', 'F')");

	      $stmt = $db->prepare('SELECT id, val from test');

	      $stmt->execute();
	      print_r($stmt->fetchAll());

	      unset($stmt);
	      unset($db);
	      ?>

	      The above example will output:

	      Array
	      (
		  [0] => Array
		      (
			  [ID] => A
			  [0] => A
			  [VAL] => B
			  [1] => B
		      )

		  [1] => Array
		      (
			  [ID] => C
			  [0] => C
			  [VAL] => D
			  [1] => D
		      )

		  [2] => Array
		      (
			  [ID] => E
			  [0] => E
			  [VAL] => F
			  [1] => F
		      )

	      )

	This example shows how to execute a query in 4D language, and how to read the result through PDO_4D.

       Example #2

	      Accessing 4D language from pdo_4d

	       Set  up a 4D method, called method. Make sure in the method properties that the option Available via SQL is checked. The 4D code is
	      the following.

	      C_TEXTE($0)
	      $0:=Version application(*);

	       The PHP code to use the above 4D method is :

	      <?php
	      $dsn = '4D:host=localhost;charset=UTF-8';
	      $user = 'test';
	      $pass = 'test';

	      // Connection to the 4D server
	      $db = new PDO($dsn, $user, $pass);

	      $stmt = $db->prepare('SELECT {FN method() AS VARCHAR } FROM _USER_SCHEMAS LIMIT 1');

	      $stmt->execute();
	      print_r($stmt->fetchAll());

	      unset($stmt);
	      unset($db);
	      ?>

	      The above example will output:

	      (
		  [0] => Array
		      (
			  [<expression>] => F0011140
			  [0] => F0011140
		      )

	      )

       Example #3

	      Escaping 4D table names

	       This examples illustrates how to escape characters in a 4D SQL query.

	      <?php
	      $dsn = '4D:host=localhost;charset=UTF-8';
	      $user = 'test';
	      $pass = 'test';

	      // Connection to 4D server 4D
	      $db = new PDO($dsn, $user, $pass);

	      $objects = array('[',']','[]','][','[[',']]','[[[',']]]','TBL ]]32[23');

	      foreach($objects as $id => $object) {
		  $object = str_replace(']',']]', $object);
		  print "$object
";

		  $db->exec('CREATE TABLE IF NOT EXISTS ['.$object.'](['.$object.'] FLOAT)');

		  $req = "INSERT INTO [$object] ([$object]) VALUES ($id);";
		  $db->query($req);

		  $q = $db->prepare("SELECT [$object] FROM [$object]");
		  $q->execute();
		  $x[] = $q->fetch(PDO::FETCH_NUM);

		  $db->exec('DROP TABLE ['.$object.'];');
	      }

	      ?>

	      The above example will output:

	      [
	      ]]
	      []]
	      ]][
	      [[
	      ]]]]
	      [[[
	      ]]]]]]
	      TBL ]]]]32[23

PHP Documentation Group 												   EXAMPLES-WITH-PDO_4D(3)
All times are GMT -4. The time now is 07:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy