The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Directory Creation problem namishtiwari Shell Programming and Scripting 1 02-05-2008 04:04 AM
Filesystem creation over existing Directory TheDoc AIX 0 04-03-2006 05:18 AM
creation of unwanted directory mridula High Level Programming 6 10-05-2005 08:40 AM
Mass directory creation? AeroEngy UNIX for Dummies Questions & Answers 6 07-21-2005 09:57 AM
directory creation sveera UNIX for Advanced & Expert Users 4 05-17-2005 10:06 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-03-2004
Registered User
 

Join Date: Nov 2004
Posts: 10
Remote directory creation

Is there a way to create a directory in some remote location from a local location?

I understand that we can use 'rcp' to copy a local file to a remote location.

I am looking for a command in similar lines which lets us create directories in remote locations.

Could someone help?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 11-04-2004
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,459
rcp should create subdirectories on the remote system, assuming privileges are correct.

Try remsh to execute the mkdir command remotely. (rexec is similar). remsh allows only one command, then breaks the connection. SO, to create the directory, then set privileges would require two lines -- two remsh commands.
Reply With Quote
  #3 (permalink)  
Old 11-04-2004
Registered User
 

Join Date: Sep 2003
Location: Canada
Posts: 56
Add your public key to ~user/.ssh/authorized_keys on host and then:
Code:
ssh user@host mkdir path
.
Reply With Quote
  #4 (permalink)  
Old 11-05-2004
Registered User
 

Join Date: Nov 2004
Posts: 10
Hi Jim,
Thanks a lot for your suggestion :-)

I used 'rsh <remote server> mkdir -p <remote dir>' and it worked fine. Think, remsh should have done the same for me...

Hey I dont think 'rcp' could create subdirectories on a remote system. Tried it out and failed saying 'No such file or directory'

Thanks again...
Reply With Quote
  #5 (permalink)  
Old 11-05-2004
Registered User
 

Join Date: Nov 2004
Posts: 10
Hi AbEnd,

Thank you for your reply

But could not work it out... Could you tell me what a public key is?

I tried to execute 'ssh user@host mkdir path' but then, it prompts me for a password
Reply With Quote
  #6 (permalink)  
Old 11-05-2004
Moderator
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,420
This is actually a "trick" that allows SSH to not prompt for password for logging in a remote session, by trying public key authentication first. If public key authentication fails, password authentication will be tried as a last resort.

Use ssh-keygen to generate a key pair. The private key is kept in your local account. The output key will be left in a file like id_rsa.pub and you just paste the line to ~/.ssh/authorized_keys on whatever remote host you would like to log on without prompting for password.

Note that you need to ensure the .ssh directory is readable by the account owner only or public key authentication may not work.

You will find more information on how to use ssh-keygen by a search online.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0