ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i tried like this to send a file from one system to others
Code:
scp file1.txt userid@remote_box:
and also this
[CODE]
scp -rp /root/Desktop/html.txt remote:/root
[/CPDE]
This will take the file1.txt from the local system and put it in the home directory of userid of the remote system. For the "remote_box" you can use its IP or hostname.
but it is not working fine.
i would like to send via E-Mail from network.
how can i know userid of the remote system.
inplace of this i given ip address(that is known ip address)
it asking his/her password.
then how can i do.
i seen this in a software(file sending)
can i tell the name of the software.
You haven't said what level of programming you want to use, so I will pick the middle ground and suggest perl. The Mail::Mailer Mail::Send modules in the MailTools package are probably a good place to start. See the docs on cpan.org.
i tried like this to send a file from one system to others
Code:
scp file1.txt userid@remote_box:
and also this
Code:
scp -rp /root/Desktop/html.txt remote:/root
Why are you using -r?
Code:
scp -p /root/Desktop/html.txt remote:/root
Quote:
This will take the file1.txt from the local system and put it in the home directory of userid of the remote system. For the "remote_box" you can use its IP or hostname.
but it is not working fine.
What does "not working fine" mean? What does happen? What output do you get from the command?
You have to have the remote system defined in your '/etc/hosts' file.
Example:
Code:
10.42.42.2 backupserver
192.168.2.59 mailserver
... ...
IPHostname by which YOU would like to reference remote system by.
Quote:
Originally Posted by munna_dude
ot working fine in the sense
it is asking ip address and his system password
this the problem
suppose i wanna send a file to u.
how can send?
i didnt know ur ip adress and also ur system password ...
please help me in this way
SCP just makes use of creating secure sockets (SSL) over intranets (local networks). In theory, you could try doing it, but in North America, unless you have a business line, or pay X amount of dollars extra per month, you will always have a dynamic IP, and thus would mean you would have to re-edit your /etc/hosts file, or somehow obtain the other person's IP address everytime they reset their WAN connection.
The only feasable way to send somebody a file across the internet is by strictly using a DNS server that the remote host is catalogued on, and the remote host running SSH and/or FTP server daemons.
Either way, a static IP is required, or some unobtrusive way of refreshing your IP/host definitions upon every WAN re-connection.
You have to have the remote system defined in your '/etc/hosts' file.
No, you don't; a URL will work.
Quote:
Example:
Code:
10.42.42.2 backupserver
192.168.2.59 mailserver
... ...
IPHostname by which YOU would like to reference remote system by.
SCP just makes use of creating secure sockets (SSL) over intranets (local networks). In theory, you could try doing it, but in North America, unless you have a business line, or pay X amount of dollars extra per month, you will always have a dynamic IP, and thus would mean you would have to re-edit your /etc/hosts file, or somehow obtain the other person's IP address everytime they reset their WAN connection.
There is nothing preventing anyone from using scp to copy a file to any other machine, anywhere in the world. For example, I copy files from my home machine (in Toronto, Canada) to my website (in Texas, USA) with a line like this:
Code:
scp "$HOME/file.html" cfaj@freeshell.org:
For that to work, you either need the password or have host-key authentication set up.
If you don't have either of those, you could use anonymous FTP -- if the remote machine is set up to use it.
Failing that, send it by e-mail. There are many examples of how to send files by e-mail on the web (e.g., http://www.shelldorado.com/scripts/) and in Usenet newsgroups.
Quote:
The only feasable way to send somebody a file across the internet is by strictly using a DNS server that the remote host is catalogued on, and the remote host running SSH and/or FTP server daemons.
Either way, a static IP is required, or some unobtrusive way of refreshing your IP/host definitions upon every WAN re-connection.
There is absolutely no need for a static IP. You don't need to know the IP address.
I was under the impression static IPs were needed because anytime my DHCP server, at home, has to restart, I begrugdingly have to manually edit all of the /ets/hosts files on all of my other machines; simply typing in the hostname as a URL has yet to work for me.
There is nothing preventing anyone from using scp to copy a file to any other machine, anywhere in the world. For example, I copy files from my home machine (in Toronto, Canada) to my website (in Texas, USA) with a line like this:
Code:
scp "$HOME/file.html" cfaj@freeshell.org:
For that to work, you either need the password or have host-key authentication set up.
...
There is absolutely no need for a static IP. You don't need to know the IP address.
But part of why that works is that freeshell.org has DNS setup. You can't just a connect a random machine to the internet, give it a random name and expect every computer in the world to know about that name automagically.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.