I have a test.sh file and I want to copy this file from my local computer to the remote server. How I can do this? I tried using scp but it does't work. Maybe I done something wrong.
            Asked
            
        
        
            Active
            
        
            Viewed 499 times
        
    -2
            
            
        2 Answers
2
            Imagine hello.txt is the file you want to move. Directory you are standing on contains this file.
Run scp hello.txt root@YOUR_SERVER:/root.
This will copy hello.txt to your root's home directory. Run cd ~ on your server and you will see your file.
In this example I used root account, but you can also use another account too
 
    
    
        ouflak
        
- 2,458
- 10
- 44
- 49
 
    
    
        Luka Samkharadze
        
- 111
- 1
- 12
0
            
            
        scp user@IP-address:exact-path-of-file-you-want-to-copy 
Then, enter the password for the remote system.
Alternatively, you can try this:
scp your.sh Server-Name@Ip-address:Path-in-Server
And then, enter the password of the remote system.
 
    
    
        Anonymous
        
- 1
- 3
- 
                    I've edited your answer to improve the formatting. It was unclear if, on the last line, you ended for the password to be part of the command or not. If you did, please edit your answer to clarify that. Regardless, please review my edits so you can see how to provide this type of formatting in the future. – Jeremy Caney Nov 14 '21 at 00:55
