|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all, What I have already done: 1. Same user created on both system and passwordless ssh form system a to system b through that user I need to write a small script to copy /etc/shadow file of sytem a to system b, script needs to be executed on system b. But as /etc/shadow file is owned by root ,it shows message like permission denied. inshort i want to execute Code:
scp 192.168.1.21:/etc/shadow localmachine |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
You'll have to log in as root, or somehow contrive to get root access after logging in.
Even the slightest insecurity in the system you use could have dire consequences. |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Hey ,
But give me an exaple as how to do it ? Thanks, Manali |
|
#4
|
|||
|
|||
|
on Server A as root user Code:
chmod 444 /etc/shadow on server B as root user Code:
chmod 644 /etc/shadow cp /etc/shadow /etc/shadow.keep # this is to revert if it screws up scp me@serverA::/etc/shadow . chmod 400 /etc/shadow TEST several user logins on serverB. Note: Create separate processes for login testing, KEEP YOUR root PROCESS active no matter what, so if you broke stuff, you can still fix it. If you really broke things, nobody can login to serverB, including root. Use the copy /etc/shadow.keep to restore. Go back to serverA Code:
chmod 400 /etc/shadow This effort will not work to duplicate passwords if you are using NIS or LDAP or you have messed with PAM setup on either box. |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
HI ,
Thanks for your replies. But my requirement is this. below is my script and I need to SCP /etc/shadow from remote server to my DR system. Now please guide as how to accomplish thisbecause it ask for root password before copying, NOte I have setpasswordless login from same user on all the systems. #!/bin/bash MACHINE=mainserver for server in "system1" "system2" "system3" "system4" "system5" SSH_SERVER=`ssh $server exec uname -n` echo "Copying file from $SSH_SERVER......." if [ $SSH_SERVER = $MACHINE ]; then scp -q $SSH_SERVER:/etc/passwd /DR/$SSH_SERVER scp -q $SSH_SERVER:/etc/group /DR/$SSH_SERVER scp -q $SSH_SERVER:/etc/services /DR/$SSH_SERVER /etc/profile scp -q $SSH_SERVER:/etc/printers.conf /DRs/$SSH_SERVER scp -q $SSH_SERVER:/etc/profile /DR/$SSH_SERVER scp -q $SSH_SERVER:/etc/dfs/dfstab /DR/$SSH_SERVER scp -q $SSH_SERVER:/etc/dfs/sharetab /DR/$SSH_SERVER scp -q $SSH_SERVER:/etc/vfstab /DR/$SSH_SERVER scp -q $SSH_SERVER:/etc/shells /DR/$SSH_SERVER else scp -q $SSH_SERVER:/etc/passwd /DR/$SSH_SERVER scp -q $SSH_SERVER:/etc/group /DR/$SSH_SERVER scp -q $SSH_SERVER:/etc/services /DR/$SSH_SERVER scp -q $SSH_SERVER:/etc/printers.conf /DR/$SSH_SERVER scp -q $SSH_SERVER:/etc/profile /DR/$SSH_SERVER scp -q $SSH_SERVER:/etc/vfstab /DR/$SSH_SERVER scp -q $SSH_SERVER:/etc/shells /DR/$SSH_SERVER fi done |
| Sponsored Links | |
|
|
#6
|
||||
|
||||
|
You cannot copy /etc/shadow in the same way as you are scp'ing /etc/passwd and the other files you list. You need root permission to make this happen because of the mode (permissions) of /etc/shadow. Just doing a passwordless scp is not going to fix this issue for you.
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using SCP command in IBM AIX to download file from remote to local system | gravi2020 | UNIX for Advanced & Expert Users | 1 | 01-30-2009 06:39 AM |
| /etc/shadow file.... | avcert1998 | UNIX for Advanced & Expert Users | 6 | 01-18-2008 02:40 PM |
| shadow file | arunkumar_mca | UNIX for Dummies Questions & Answers | 3 | 12-31-2004 10:55 PM |
| Changing Unix form to Microsoft Word form to be able to email it to someone. | Cheraunm | UNIX for Advanced & Expert Users | 8 | 05-24-2002 03:58 AM |
|
|