Remote directory creation


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Remote directory creation
# 1  
Old 11-04-2004
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?
# 2  
Old 11-04-2004
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.
# 3  
Old 11-04-2004
Add your public key to ~user/.ssh/authorized_keys on host and then:
Code:
ssh user@host mkdir path

.
# 4  
Old 11-05-2004
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...
# 5  
Old 11-05-2004
Hi AbEnd,

Thank you for your reply Smilie

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 Smilie
# 6  
Old 11-05-2004
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reason for no directory creation date

i read here that linux provides no way to determine when a directory was created. https://www.unix.com/shell-programming-and-scripting/157874-creation-date-directory.htmlI have a directory /home/andy/scripts that had a README file in it. That file says I put the script in that directory and... (3 Replies)
Discussion started by: drew77
3 Replies

2. UNIX for Beginners Questions & Answers

UNIX directory creation issues

Hi All, I am facing a strange scenario. I upgraded my server version to new version of linux. After the when I create a directory it is created with . in the the permission . What is the reason and how to fix . $ mkdir test $ ls -l total 0 drwxr-xr-x. 2 uk01 users 6 Dec 7 03:49 test ... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

3. Shell Programming and Scripting

FTP files from different directory from remote server to one directory in local

Hi All, I want to search for .log files from folders and sub folders in remote server and FTP them to one particular folder in the local machine. I dont want to copy the entire directory tree structure, just have to take all the .log files from all the folders by doing a recursive search from the... (3 Replies)
Discussion started by: dassv
3 Replies

4. Shell Programming and Scripting

Creation date of a directory

what's the command to find the creation date of a certain dirctory? (1 Reply)
Discussion started by: miss_dodi
1 Replies

5. AIX

Error - Creation remote printer

Guy's I'm trying to configure new remote printer by smitty in AIX 6.1 but I'm facing below message ! and creating did not completed ... can you please help in this ! Command: failed stdout: yes stderr: no Before command completion, additional instructions may appear below. digest:... (2 Replies)
Discussion started by: ITHelper
2 Replies

6. Shell Programming and Scripting

Directory Creation problem

Hiiii, here is my script-- BackupLocation="$OPTARG" if ]; then echo "Either option l or L should be given to $Programname" echo "$Usage" echo "$Programname is terminated" ... (1 Reply)
Discussion started by: namishtiwari
1 Replies

7. AIX

Filesystem creation over existing Directory

Is it possible to create a Filesystem with the mount point over an existing Directory, without loosing the data in the Directory? eg:- /u01 -> /pmmpd/u01 (Directory with soft link) /pmmpd/u01 (Need to create this filesystem, without loosing data) Thanks TheDoc (0 Replies)
Discussion started by: TheDoc
0 Replies

8. Programming

creation of unwanted directory

hi all i have a file with server id's and I need to create a directory corresponding to each server id listed in the text file. eg: id directory name 1 node_1 2 ... (6 Replies)
Discussion started by: mridula
6 Replies

9. UNIX for Dummies Questions & Answers

Mass directory creation?

I have a couple thousand data files that all have to have there own directory named exactly the same as the file name. Then the file needs to be moved to that directory. For example files test1.mat, test2.mat, test3.mat in directory X need to have directories test1, test2, test3 created... (6 Replies)
Discussion started by: AeroEngy
6 Replies

10. UNIX for Advanced & Expert Users

directory creation

Hi Friends, I am trying to move some files from one directory to another. but if the destination directory doesnt exist then i have to create one and then move files to that. For this i have to write a script. please help. thanks in advance Veera (4 Replies)
Discussion started by: sveera
4 Replies
Login or Register to Ask a Question