🕵️ SicherheitslückenWhat continuous operational resilience looks like under DORA(09.09.2026 um 17:53 Uhr)
🔧 AI Nachrichten OpenAI seeks tougher AI rules. CIOs may feel the ripple effects(10.09.2026 um 12:11 Uhr)
🔧 AI Nachrichten Mistral valued at €21bn after €3bn Series D funding round(08.09.2026 um 10:19 Uhr)
🪟 Windows TippsWindows XP's Cursor Indicator Is Getting a Windows 11 Refresh(25.08.2026 um 13:00 Uhr)
🕵️ SicherheitslückenWhat continuous operational resilience looks like under DORA(09.09.2026 um 17:53 Uhr)
🔧 AI Nachrichten OpenAI seeks tougher AI rules. CIOs may feel the ripple effects(10.09.2026 um 12:11 Uhr)
🔧 AI Nachrichten Mistral valued at €21bn after €3bn Series D funding round(08.09.2026 um 10:19 Uhr)
🪟 Windows TippsWindows XP's Cursor Indicator Is Getting a Windows 11 Refresh(25.08.2026 um 13:00 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 4 Min Lesezeit
0

SSH Made Easy: Enable Secure Access and File Transfers Like a Pro

↗ Quelle (dev.to)
🗣️ Stimme:

What is SSH?



SSH (Secure Shell) is a protocol that provides secure access to remote systems over an encrypted network. It allows users to:




  • Log in to remote systems.


  • Execute commands remotely.


  • Transfer files securely.




Step-by-Step Guide to Enable SSH Between Two Linux Machines



Prerequisites




  • Two Linux machines with SSH installed (most distributions have SSH pre-installed).


  • Access to root or a user with sudo privileges on both machines.




1. Check SSH Installation



Verify that SSH is installed on both machines:



sudo systemctl status sshd



If not installed, install it using:



For Ubuntu/Debian

sudo apt install openssh-server



For RHEL/CentOS

sudo yum install openssh-server



2. Start and Enable SSH Service



Ensure the SSH service is active and enabled to start on boot:



sudo systemctl start sshd

sudo systemctl enable sshd



3. Configure SSH (Optional)



Modify the SSH configuration file for additional security or customization:



sudo nano /etc/ssh/sshd_config



Key settings to check or modify:



Port: Default is 22. You can change it to another port for security.



PermitRootLogin: Set to no to prevent root login.



PasswordAuthentication: Set to no to enforce key-based authentication.



After making changes, restart the SSH service:



sudo systemctl restart sshd



4. Generate SSH Key Pair



Generate a public-private key pair on the source machine:



ssh-keygen -t rsa -b 4096



The default location is ~/.ssh/id_rsa (private key) and ~/.ssh/id_rsa.pub (public key).



5. Share the Public Key



Copy the public key (id_rsa.pub) from the source machine to the remote machine:



ssh-copy-id user@remote_machine



Alternatively, manually append the public key to the ~/.ssh/authorized_keys file on the remote machine:



cat ~/.ssh/id_rsa.pub | ssh user@remote_machine "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys



chmod 600 ~/.ssh/authorized_keys



6. Test SSH Connectivity



Attempt to log in without a password:



ssh user@remote_machine






1. SCP (Secure Copy Protocol)



SCP is a simple command-line tool for securely transferring files between Linux systems over SSH. It encrypts data in transit.



Syntax

scp [options] source destination



Examples




  • Copy a file from local to remote server:

    scp file.txt user@remote:/path/to/destination/


  • Copy a file from remote to local:

    scp user@remote:/path/to/file.txt /local/destination/


  • Copy a directory recursively:

    scp -r /local/directory/ user@remote:/path/to/destination/




Important Options



-r Recursively copy directories.

-C Enable compression for faster transfer of large files.

-v Verbose mode for debugging.

-p Preserve the permission and ownership






2. PSCP (PuTTY SCP)



PSCP is SCP's counterpart on Windows systems, provided by the PuTTY suite.



Setup




  • Download PuTTY and ensure pscp.exe is in your PATH.



Syntax

pscp [options] source destination



Examples




  • Copy a file from local to remote server:

    pscp file.txt user@remote:/path/to/destination/


  • Copy a file from remote to local:

    pscp user@remote:/path/to/file.txt C:\local\destination\


  • Specify SSH port:

    pscp -P 2222 file.txt user@remote:/path/to/destination/




Important Options



-r Recursively copy directories.

-q Quiet mode.

-C Enable compression.

-v Verbose/debug mode.

-p Preserve the permission and ownership






3. Rsync



Rsync is more advanced than SCP, allowing incremental transfers, bandwidth control, and more.



Syntax

rsync [options] source destination



Examples




  • Copy a file from local to remote server:

    rsync file.txt user@remote:/path/to/destination/


  • Copy a directory recursively:

    rsync -r /local/directory/ user@remote:/path/to/destination/


  • Sync files while preserving permissions and timestamps:

    rsync -av /local/directory/ user@remote:/path/to/destination/


  • Use SSH for transfer:

    rsync -e ssh file.txt user@remote:/path/to/destination/


  • Transfer only modified files:

    rsync -u /local/directory/ user@remote:/path/to/destination/




Important Options



-r Recursively copy directories.

-a Archive mode: preserve permissions, timestamps, etc.

-z Enable compression for faster transfers.

-e Specify SSH as the transport protocol.

--progress Show detailed progress during transfer.

--bwlimit=<kB/s> Limit bandwidth usage.

-u Update: skip files that are newer on the destination.



Image description



Permissions and Metadata




  • SCP/PSCP: Permissions are preserved unless overridden (e.g., umask on the target).


  • Rsync: Use -a to preserve all metadata (ownership, permissions, timestamps).




Conclusion



By enabling SSH between Linux machines and mastering SCP, PSCP, and Rsync commands, you can securely transfer files and manage systems effectively. Understanding these tools not only streamlines administrative tasks but also ensures security in your operations.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Sam Altman calls GPT-6 Astra rollout ‘messy’ as enterprise users wait for access
1 Quelle
Swiss government explores replacing Microsoft 365 with open-source software
1 Quelle
What continuous operational resilience looks like under DORA
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten SSH Made Easy: Enable Secure Access and File Transfers Like a Pro

Thematisch verwandte Begriffe: Made, Easy, Enable, Secure · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...