{"data":{"external_id":2865,"slug":"how-can-i-access-a-linux-server-via-ssh-and-transfer-data","title":"How can I access a Linux server via SSH and transfer data?","content":"This guide explains how you can connect to a Linux server using SSH, transfer data between two servers, and download files to your own computer. It&#8217;s especially helpful if your main server is currently unavailable and you&#8217;re using a temporary KVM server.\nWhat is SSH and why do I need it?\nSSH (Secure Shell) is a secure protocol that allows you to log into a remote Linux server. It&#8217;s used to:\nRun commands remotely\nAccess files and directories\nTransfer data securely\nYou\u2019ll typically use the command line (terminal) to work via SSH. On Windows, you can use tools like PuTTY or WinSCP.\nHow do I connect to a Linux server via SSH?\nTo connect, you\u2019ll need:\nThe IP address of the server\nThe username (usually root)\nThe password or an SSH key\nExample (Linux, macOS, or Windows using WSL):\nssh root@123.123.123.123\nWhen connecting for the first time, you\u2019ll be asked to confirm the fingerprint. Type yes and press Enter. Then, enter your password when prompted.\nTip for Windows users: Use PuTTY as an alternative if you\u2019re not using a terminal.\nHow do I transfer data from one Linux server to another?\nMethod 1: Using scp (secure copy)\nGreat for small directories or single files.\nExample:\nscp -r \/var\/www\/html root@212.87.215.194:\/root\/html-backup\n-r means &#8222;recursive&#8220; \u2013 it transfers entire directories.\nMethod 2: Using rsync (recommended for large or repeated transfers)\nEfficient for large amounts of data or repeat transfers, as it only syncs changes.\nExample:\nrsync -avz \/var\/www\/ root@212.87.215.194:\/root\/html-backup\/\n-a: archive mode\n-v: verbose output\n-z: compression during transfer\nWhat should I do if my server uses a non-standard SSH port?\nSome servers use a custom SSH port instead of the default port 22. You\u2019ll need to specify the correct port manually.\nConnect using a custom SSH port:\nssh -p 2222 root@123.123.123.123\nUse scp with a custom port:\nscp -P 2222 -r \/var\/www\/html root@destination:\/root\/\nUse rsync with a custom port:\nrsync -avz -e \"ssh -p 2222\" \/var\/www\/ root@destination:\/root\/html-backup\/\nHow do I download files from the server to my computer?\nOn Linux or macOS:\nscp -r root@123.123.123.123:\/root\/html-backup \/home\/yourname\/Documents\/\nWith a custom port:\nscp -P 2222 -r root@123.123.123.123:\/root\/html-backup \/home\/yourname\/Documents\/\nOn Windows using WinSCP:\nDownload WinSCP and install it.\nOpen the program and enter your connection details:\nProtocol: SCP\nHost name: Server IP address\nPort number: e.g. 2222\nUsername: root\nPassword: your SSH password\nYou can now browse server files and drag &amp; drop them to your PC.\nWhat commands should I know?\nTaskCommand\/ToolConnect via default SSH portssh root@IP-addressConnect via custom SSH portssh -p PORT root@IP-addressTransfer data using scpscp -r or scp -P PORTTransfer data using rsyncrsync -avz or rsync -e \"ssh -p PORT\"Download data to local PCscp (Linux\/macOS) or WinSCP (Windows)\nHow can I keep transfers running overnight?\nPro tip: If you&#8217;re running a large transfer that may take a while (e.g., overnight), it&#8217;s best to use the screen tool. This allows the process to continue even if you disconnect from the server or lose your internet connection.\nHere&#8217;s how to use it:\nStart a new screen session: screen -S transfer\nRun your transfer command inside the screen session (e.g., rsync or scp).\nTo detach the screen session without stopping the process:\nPress: Ctrl + A, then D\nTo resume the session later: screen -r transfer\nIf screen is not installed:\napt install screen\nThis way, you avoid interruptions and can safely run transfers in the background.\nWhat can I do if I need help?\nIf you\u2019re unsure or need assistance transferring your data, feel free to contact our support team.","schema":null,"facts":[],"links":[{"type":"external","url":"https:\/\/winscp.net\/","data":{"title":"WinSCP :: Official Site :: Free SFTP and FTP client for Windows","meta_description":"WinSCP is a free file manager for Windows supporting FTP, SFTP, S3 and WebDAV.","meta":{"":"1","viewport":"width=device-width, initial-scale=1","keywords":"file manager,sftp client,scp client,ftp client,windows,secure file transfer,ftp,freeware","google-site-verification":"R-0cOllfdlHe93mQzthYHV_GUkAImaodzbyD5--pXOQ","DCTERMS.modified":"2026-03-25T12:16:28+01:00"}}}]}}