Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #38373 > unrolled thread

How to create a file in other machine home directory with help of other host username and password or IP adress?

Started bysiddareddy.moolam@gmail.com
First post2018-06-14 03:19 -0700
Last post2018-06-15 11:03 +0000
Articles 7 — 3 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  How to create a file in other machine  home directory with help of other host username and password or IP adress? siddareddy.moolam@gmail.com - 2018-06-14 03:19 -0700
    Re: How to create a file in other machine  home directory with help of other host username and password or IP adress? Martin Gregorie <martin@mydomain.invalid> - 2018-06-14 12:44 +0000
      Re: How to create a file in other machine  home directory with help of other host username and password or IP adress? siddareddy.moolam@gmail.com - 2018-06-14 05:47 -0700
        Re: How to create a file in other machine  home directory with help of other host username and password or IP adress? Martin Gregorie <martin@mydomain.invalid> - 2018-06-14 15:01 +0000
          Re: How to create a file in other machine home directory with help of other host username and password or IP adress? Arne Vajhøj <arne@vajhoej.dk> - 2018-06-14 11:49 -0400
            Re: How to create a file in other machine home directory with help of other host username and password or IP adress? siddareddy.moolam@gmail.com - 2018-06-14 22:02 -0700
              Re: How to create a file in other machine home directory with help of other host username and password or IP adress? Martin Gregorie <martin@mydomain.invalid> - 2018-06-15 11:03 +0000

#38373 — How to create a file in other machine home directory with help of other host username and password or IP adress?

Fromsiddareddy.moolam@gmail.com
Date2018-06-14 03:19 -0700
SubjectHow to create a file in other machine home directory with help of other host username and password or IP adress?
Message-ID<1ee9d152-0cad-4905-becf-13e5c30c5368@googlegroups.com>
java code:

package com.techstar.com;

import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;

class UpDown{
public static void main(String[] args) throws UnknownHostException, IOException {
    String ipAddress = "192.168.15.49";
    InetAddress inet = InetAddress.getByName(ipAddress);

    System.out.println("Sending Ping Request to " + ipAddress);
    System.out.println(inet.isReachable(5000) ? "Host is reachable" : "Host is NOT reachable");

    ipAddress = "192.168.15.38";
    inet = InetAddress.getByName(ipAddress);

    System.out.println("Sending Ping Request to " + ipAddress);
    System.out.println(inet.isReachable(5000) ? "Host is reachable" : "Host is NOT reachable");
}}

[toc] | [next] | [standalone]


#38374

FromMartin Gregorie <martin@mydomain.invalid>
Date2018-06-14 12:44 +0000
Message-ID<pftnvb$ti3$1@news.albasani.net>
In reply to#38373
On Thu, 14 Jun 2018 03:19:54 -0700, siddareddy.moolam wrote:

>     String ipAddress = "192.168.15.49";
>     InetAddress inet = InetAddress.getByName(ipAddress);
>
Try reading Javadocs for InetAddress. 

Hint: The contents of ipAddress is *NOT* the hostname.



-- 
Martin    | martin at
Gregorie  | gregorie dot org

[toc] | [prev] | [next] | [standalone]


#38375

Fromsiddareddy.moolam@gmail.com
Date2018-06-14 05:47 -0700
Message-ID<7f51ae54-d418-435d-8e8b-134a27f7395b@googlegroups.com>
In reply to#38374
On Thursday, 14 June 2018 18:14:35 UTC+5:30, Martin Gregorie  wrote:
> On Thu, 14 Jun 2018 03:19:54 -0700, siddareddy.moolam wrote:
> 
> >     String ipAddress = "192.168.15.49";
> >     InetAddress inet = InetAddress.getByName(ipAddress);
> >
> Try reading Javadocs for InetAddress. 
> 
> Hint: The contents of ipAddress is *NOT* the hostname.
> 
> 
> 
> -- 
> Martin    | martin at
> Gregorie  | gregorie dot org
thats ip adress is working fine
i need to create file in other remote machine also ..so please help me strucked 

[toc] | [prev] | [next] | [standalone]


#38376

FromMartin Gregorie <martin@mydomain.invalid>
Date2018-06-14 15:01 +0000
Message-ID<pftvvo$2br$1@news.albasani.net>
In reply to#38375
On Thu, 14 Jun 2018 05:47:52 -0700, siddareddy.moolam wrote:

> On Thursday, 14 June 2018 18:14:35 UTC+5:30, Martin Gregorie  wrote:
>> On Thu, 14 Jun 2018 03:19:54 -0700, siddareddy.moolam wrote:
>> 
>> >     String ipAddress = "192.168.15.49";
>> >     InetAddress inet = InetAddress.getByName(ipAddress);
>> >
>> Try reading Javadocs for InetAddress.
>> 
>> Hint: The contents of ipAddress is *NOT* the hostname.
>> 
>> 
>> 
>> --
>> Martin    | martin at Gregorie  | gregorie dot org
> thats ip adress is working fine i need to create file in other remote
> machine also ..so please help me strucked

Assuming that the target machine has an FTP server running, try
   org.apache.commons.net.ftp.FTPClient

from 

https://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/
net/ftp/FTPClient.html

or if it has sshd running, try Jsch from http://www.jcraft.com/jsch/

Disclaimer: I haven't used either of these packages, only looked at their 
documentation.


-- 
Martin    | martin at
Gregorie  | gregorie dot org

[toc] | [prev] | [next] | [standalone]


#38377 — Re: How to create a file in other machine home directory with help of other host username and password or IP adress?

FromArne Vajhøj <arne@vajhoej.dk>
Date2018-06-14 11:49 -0400
SubjectRe: How to create a file in other machine home directory with help of other host username and password or IP adress?
Message-ID<pfu2po$80v$1@gioia.aioe.org>
In reply to#38376
On 6/14/2018 11:01 AM, Martin Gregorie wrote:
> Assuming that the target machine has an FTP server running, try
>     org.apache.commons.net.ftp.FTPClient
> 
> from
> 
> https://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/
> net/ftp/FTPClient.html
> 
> or if it has sshd running, try Jsch from http://www.jcraft.com/jsch/
> 
> Disclaimer: I haven't used either of these packages, only looked at their
> documentation.

I have used FTPClient.

It works fine.

Note that FTP protocol send password ion clear text. Not good security.

SFTP/FTPS is better in that regard.

Arne

[toc] | [prev] | [next] | [standalone]


#38382 — Re: How to create a file in other machine home directory with help of other host username and password or IP adress?

Fromsiddareddy.moolam@gmail.com
Date2018-06-14 22:02 -0700
SubjectRe: How to create a file in other machine home directory with help of other host username and password or IP adress?
Message-ID<f664eca7-fbf2-4064-a581-611afa50a679@googlegroups.com>
In reply to#38377
On Thursday, 14 June 2018 21:19:25 UTC+5:30, Arne Vajhøj  wrote:
> On 6/14/2018 11:01 AM, Martin Gregorie wrote:
> > Assuming that the target machine has an FTP server running, try
> >     org.apache.commons.net.ftp.FTPClient
> > 
> > from
> > 
> > https://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/
> > net/ftp/FTPClient.html
> > 
> > or if it has sshd running, try Jsch from http://www.jcraft.com/jsch/
> > 
> > Disclaimer: I haven't used either of these packages, only looked at their
> > documentation.
> 
> I have used FTPClient.
> 
> It works fine.
> 
> Note that FTP protocol send password ion clear text. Not good security.
> 
> SFTP/FTPS is better in that regard.
> 
> Arne

i want to use SCP please help me for creating file in remote machine

[toc] | [prev] | [next] | [standalone]


#38383 — Re: How to create a file in other machine home directory with help of other host username and password or IP adress?

FromMartin Gregorie <martin@mydomain.invalid>
Date2018-06-15 11:03 +0000
SubjectRe: How to create a file in other machine home directory with help of other host username and password or IP adress?
Message-ID<pg06dt$mfv$1@news.albasani.net>
In reply to#38382
On Thu, 14 Jun 2018 22:02:32 -0700, siddareddy.moolam wrote:

> On Thursday, 14 June 2018 21:19:25 UTC+5:30, Arne Vajhøj  wrote:
>> On 6/14/2018 11:01 AM, Martin Gregorie wrote:
>> > Assuming that the target machine has an FTP server running, try
>> >     org.apache.commons.net.ftp.FTPClient
>> > 
>> > from
>> > 
>> > https://commons.apache.org/proper/commons-net/apidocs/org/apache/
commons/
>> > net/ftp/FTPClient.html
>> > 
>> > or if it has sshd running, try Jsch from http://www.jcraft.com/jsch/
>> > 
>> > Disclaimer: I haven't used either of these packages, only looked at
>> > their documentation.
>> 
>> I have used FTPClient.
>> 
>> It works fine.
>> 
>> Note that FTP protocol send password ion clear text. Not good security.
>> 
>> SFTP/FTPS is better in that regard.
>> 
>> Arne
> 
> i want to use SCP please help me for creating file in remote machine

Try using Jsch (link above) OR use ProcessBuilder to launch the scp 
program. Either way, let us now how it goes: its difficult to say 
anything more since we don't know what you're trying to achieve, what the 
constraints may be or why you want to do it.


-- 
Martin    | martin at
Gregorie  | gregorie dot org

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web