Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
There is less than 24 hours left to vote in the 2015 LinuxQuestions.org Members Choice Awards. Click here to go to the polls. Vote now and make sure your voice is heard!
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Is it possible to use ftp to transfer a file from pc1 to pc2 with fix source location on pc1 and fix loaction on pc2 where it is to be copied/overwritten using any shell script or C program?
can scp is used for same purpose? how can i use that command in C program?
one more thing how a socket program can help in my condition?
You could use a socket program to send the file. Don't do that, as there are dozens of standards you could use, and you're more likely to make it less secure by using a custom program (fewer users => more bugs; security through obscurity doesn't work).
will copy silly.txt from the pwd of the local pc and copy it in the home directory of john on the pc who's hostname is dadspc. dadspc can be replaced with the ip address. 192.168.1.3 etc.
scp john@dadspc:silly.txt .
will copy silly.txt from the home directory of john on dadspc and place it in the pwd directory of the local user. notice the period (.) this represents here (pwd) as in the folder/directory you are in when you issue the command.
all files are encrypted. sshd must be running on the remote machine for this to work.
check in your /etc/ssh/sshd_config file for the following
if it's uncommented, as it should be for security, this then means root can not log in. also check for the comment in the /etc/ssh/ssh_config file. on my system i had to remove it from the ssh_config file for things to work.
sshd_config - is for the server side
ssh_config - is for client side
as a rule don't do anything as root. if you have root priviiliges on the other machine. it's safer to make a copy of files into a user directory and change owner & group. then scp as user. also make shure the sshd service is running on the remote system. obviously if the server is not running it can't serve!.
if you can ssh in as root, you should be able to scp as root!!! if you can ssh in as root and not scp, then it's probably a syntax error in your scp command. post the exact scp syntax if this is the case.