Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trusted Systems Syntax

Status
Not open for further replies.

simpson

MIS
Oct 23, 2001
58
0
0
CA
All,

I have two systems, one has the ability to access the other via .rhosts. BUT yyou have to pass the username into the access commands as we do not have access to root on the remote system. The following works just perfect:

rlogin srvr2 -l tstadm
remsh srvr2 -l tstadm 'cat /etc/hosts'

What i would like to know is the syntax for rcp'ing.
rcp ?????????? file_1 srvr2:/file_1

I can't seem to find any information on how to pass a username to rcp. can someone help?
Thanks
 
rcp xxxx/yyyy/zzzz user@srv2:/xxxx/yyyy/zzzz
 
Thank you very much. This is exacly what I was looking for.
 
I recommend you install openssh and configure it to have a more secure access among your machines!

Then use this procedure to configure SSH:

Code:
Configuring SSH between Hosts

Check that the sshd subsystem is active:

lssrc –s sshd

Log in as the user you want to establish the SSH connection and execute:

ssh-keygen –t dsa

The output will be similar to:

Generating public/private dsa key pair.
Enter file in which to save the key (/home/root/.ssh/id_dsa):<Enter>
Enter passphrase (empty for no passphrase):<Enter>
Note: If you enter a passphrase, then sshd never starts, because it cannot
decrypt the private key upon startup, so leave empty
Enter same passphrase again:<Enter>
Your identification has been saved in /home/root/.ssh/id_dsa.
Your public key has been saved in /home/root/.ssh/id_dsa.pub.
The key fingerprint is:
56:06:7e:53:38:e6:70:43:c6:35:99:41:0e:35:6e:99

At this stage the only two files created in the user’s .ssh sub-directory are id_dsa and id_dsa.pub.

Execute the ssh-keygen command on the second host.

From the first host run:

scp <userid>@<IPadd>:<home_dir>/.ssh/id_dsa.pub  authorized_keys

You will get a warning message similar to the following and be prompted for the password:

The authenticity of host '<IPaddr>' can't be established.
RSA key fingerprint is f2:f1:5d:6a:a1:c3:32:51:e7:9c:3c:44:7c:f5:c3:c0.
Are you sure you want to continue connecting (yes/no)? yes

Now append your own id_dsa.pub file to the newly created authorized_keys.

cat id_dsa.pub >> authorized_keys

Send authorized_keys containing both keys back to the second host:

scp authorized_keys <userid>@<IPadd>:<home_dir>/.ssh/authorized_keys

You will again be prompted for a password. This will create a known_hosts file on the first host containing the name of the second host (plus lots of characters). On the first host, if you run:

ssh <hostname1>

then the local host will be added to the known_hosts file to allow ssh within itself (required for some applications at installation time).

On the second host run:

ssh <hostname1>

to create its own known_hosts file (it will require a password), and repeat with ssh <hostname2>.

Test that logins can be achieved from either host without passwords.

Regards,
Khalid
 
By the way after doing this you can issue scp command instead of rcp!

scp xxxx/yyyy/zzzz user@srv2:/xxxx/yyyy/zzzz

Regards,
Khlaid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top