Sponsored Content
Full Discussion: Move all user setting
Top Forums UNIX for Advanced & Expert Users Move all user setting Post 71677 by Just Ice on Friday 13th of May 2005 10:34:46 AM
Old 05-13-2005
for /etc/passwd and /etc/shadow --- just grep out the user entries and append them into the appropriate files in the new servers so the uid, gid and passwords for the users stay the same ... a lot of places use the same group file entries so if this is the case with you, you can just copy over /etc/group to the new host also ...
Code:
for i in passwd shadow
do
    egrep -v "root|lp|smtp" /etc/$i > /tmp/$i
    scp /tmp/$i newhost:/tmp/$i
    ssh newhost "cat /tmp/$i >> /etc/$i; rm /tmp/$i"
    rm /tmp/$i
done
scp -p /etc/group newhost:/etc/group

for the home-related files and directories (i.e., .bash_profile, etc.), just copy them over ... if you have remote root ssh access on the remote server you can do the code below ... (change the correct paths to the user data directories on both local and remote hosts) ... for rsh access only, change the ssh to rsh ...
Code:
cd /home
tar cvfp - * | ssh newhost "cd /newhomedir; tar xvfp -"
tar cvfp - .[a-zA-Z0-9]* | ssh newhost "cd /homedir; tar xvfp -"

=========
or ... if you are not automounting home directories ...
=========

tar cvfp - /home | ssh newhost "cd /; tar xvfp -"

=========
or ... if you are automounting home directories ... (sample assumes it is automounted from /export/home) ...
=========

(cd /export; tar cvfp - home) | ssh newhost "cd /export; tar xvfp -"

there other transfer options you can use ... see "man dd", "man ufsdump", etc. depending on your OS platform ...
 

9 More Discussions You Might Find Interesting

1. Solaris

Setting user groups

Hi......... I'm trying to set a group of users to login to do a required super-user tasks without knowing the super-user passwd. For example...a user popodude logs in as self with passwd..system accepts the password & then automatically asks for the super-user account passwd. My goal is... (1 Reply)
Discussion started by: Remi
1 Replies

2. UNIX for Advanced & Expert Users

setting password for user using useradd?

hi all i am writing a script to create user and group from the input given to script for eg. script needs to values 1. mode - 1 or 2 2. id - if mode is 1 then id should be 2 char like x1 / v1 / v2 if mode is 2 then id should be 1 char like x / v / e from these to values group is... (1 Reply)
Discussion started by: zedex
1 Replies

3. UNIX for Advanced & Expert Users

Switch user :NOPASSWD setting

Hi All, I want trigger a script "abhishektest.sh "whenever a mail come to a user say "abhishek" in my unix server. I dont have root permission. So, for doing this i added abhishek : "|/export/abhishek/bin/wr_test.sh in /etc/mail/aliases in wr_test file : i need to put this line, as i... (2 Replies)
Discussion started by: mindtee_abhi
2 Replies

4. UNIX for Dummies Questions & Answers

PATH Setting for all shells of a user

How can I modify the path variable of a particular user in all shells? I searched in this forum and as per the advice in some threads created a new file .profile in $HOME directory with the new PATH, but it did not work. (5 Replies)
Discussion started by: JoyceBabu
5 Replies

5. Red Hat

setting ulimit for a user

The root user runs the following ulimit -a | grep open and gets a result of open files (-n) 8162 A user runs the same command and gets a result of open files (-n) 2500 How can you set the ulimit of the user to... (2 Replies)
Discussion started by: jsanders
2 Replies

6. Shell Programming and Scripting

Move Process ID from one user to another

HI, I'm search to transfer a process ID form the User A to the User B with out super user privilege. Would it be possible. Please leave your (1 Reply)
Discussion started by: Prabhu.Are
1 Replies

7. Solaris

Is there a difference between setting a user as nologin and setting it as a role?

Trying to figure out the best method of security for oracle user accounts. In Solaris 10 they are set as regular users but have nologin set forcing the dev's to login as themselves and then su to the oracle users. In Solaris11 we have the option of making it a role because RBAC is enabled but... (1 Reply)
Discussion started by: os2mac
1 Replies

8. UNIX for Dummies Questions & Answers

How to move file from one directory to other of only particular user?

I written unix script where a pdf file generates. But if the script is used by multiple people at a time it generates same pdf with two different owner names and creating a problem with permission while moving the file. is there a way where i can move the file filtering with the user? (4 Replies)
Discussion started by: lakers646
4 Replies

9. UNIX for Beginners Questions & Answers

Setting write permission for particular user

Hi All, We have a scenario in production where we want only one user from a group to modify the file. The file is not set to write permission for application manager. -r--r--r-- 1 amgr u00 15661716 Aug 30 00:06 DCI.dat So here amgr will have permission to edit the file. We want a... (10 Replies)
Discussion started by: arunkumar_mca
10 Replies
nsquery(1)						      General Commands Manual							nsquery(1)

Name
       nsquery - name server query command

Syntax
       /usr/ucb/nsquery [ lookup ] [ host ] [ server ]

Description
       The command provides an interface to obtain host name and address information.

       If  you	specify  host,	the command obtains information about the specified host. If no host is specified, the command obtains information
       about the local host system.

       If you specify server, the command queries the BIND server that you specify. If you do not  specify  a  server,	the  command  queries  the
       default BIND server.

Options
       lookup  Retrieves the host name, Internet Protocol (IP) address, and aliases of the specified host.  If no host or server is specified, the
	       command obtains information about the local system from the default BIND server.

	       If you do specify the lookup option, the command obtains the information about  the  BIND  server  and  host  specified	(or  their
	       defaults).   If the system from which you issue the command is a BIND server, and you do not specify the lookup option, information
	       about only that server is retrieved.

Files
       Directory containing BIND server data file

       BIND server boot file

       Host database file containing name to address mapping for BIND primary
			   server

       Host database file containing address to name mapping for BIND primary
			   server

       Local host database file containing address to name mapping for BIND
			   server

       BIND server cache file

       BIND data file

See Also
       nslookup(1), resolver(3), resolver(5), named(8)
       Guide to the BIND/Hesiod Service

																	nsquery(1)
All times are GMT -4. The time now is 07:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy