Link to home
Start Free TrialLog in
Avatar of Member_2_4942450
Member_2_4942450

asked on

How do I in shell terminal copy an entire file or directory file from one linux server to anouther linux server

Ok I have centos os account on one server and I want to pull in my files from another server.

I want to do this in terminal mode. By ssh into the remote server getting my entire directory and copying it to my current location.
How would I do this
SOLUTION
Avatar of medvedd
medvedd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Josef Pospisil
Josef Pospisil
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Member_2_4942450
Member_2_4942450

ASKER

I am trying to copy the home directory

would path be

/home/myname
usr/home/myname
I want everything from the home directory
scp root@192.168.178.1:/directory/file /local/directory/

Worked how would I eliminate hidden files?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you
I tried this with another vm machine Solaris 10

and got this when I typed the line

ssh: connect to host columbia.com port22: Connection refused

What does this mean it worked ok on another vm
That means columbia.com is not listening on port 22 or you cannot reach at port 22 of the server. It could be reachability issues or just the server is not listening to that port for anyone. Make sure sshd is running on the remote server.
You may verify if the server is listening to ssh by issueing following command:
$ netstat -na | grep 22
      *.22                 *.*                0      0 49152      0 LISTEN
If you see something like *.22 then it is listening on port 22.

First make sure you can ping to that server.
Or sometimes, even when ssh is running you are not allowed ssh using root. Check /etc/ssh/sshd_config file at the remote server.