Uploading text files into ssh account
I am using my instructor's account, connecting with ssh via terminal. I am trying to upload a text file into this account but couldn't find a command for this. I tried to copy the index of file and paste it into a file created by 'nano' command, but i think this causes some problems for my calculations. Any suggestions ?
There are at least two, no -- three options. Four options. Amongst our options...
-
scp
can be used to directly copy files, in the style of thecp
command line:scp filename yourlogin@server:/target/folder
-
The
sftp
commands works likeftp
: you start it, and then can use the ftp-style commands likeput
andget
to transfer files back and forth. Here is a sample session:myname@leukothea:~/tmp4$ sftp myname@leukothea:/tmp Connecting to leukothea... Changing to: /tmp sftp> put log.txt Uploading log.txt to /tmp/log.txt log.txt 100% 26 0.0KB/s 00:00 sftp> ls RtmpEZgt4t RtmpU3qZ4z log.txt sftp> quit
You can use one of the numerous programs for FTP/SFTP, including
Nautilus
-- just entersftp://username@server:/path/to/dir
to the Location bar. Now you can just drag files to the target directory.You can use
rsync
to synchronize whole folders, keeping modification times etc. This is one of the most useful commands.-
Five, five, not four. You can use
sshfs
to mount your ssh-accessible filesystem like a network drive:sudo apt-get install sshfs mkdir ~/remote sshfs user@server:/path/to/dir ~/remote
You now can navigate to the
remote
folder in your home directory and use whatever local commands or tool to copy the files.