elenadj7 / securetransfer

Simple project for uploading and checking files integrity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Secure Transfer

This program is a Python script for securely transfering files using the SFTP (SSH File Transfer Protocol) protocol. It allows users to connect to an SFTP server, upload files, and perform integrity checks using SHA-512 hashing.

Usage

  1. Ensure you have Python installed on your system

  2. Clone this repository:

    git clone https://github.com/elenadj7/securetransfer.git
  3. Navigate to the project directory:

    cd securetransfer
  4. Install Paramiko:

    pip install paramiko
  5. Configure SFTP connection by editing the config.json file with your server details:

    {
     "host": "",
     "username": "your-username",
     "password": "your-password",
     "port": 22,
     "source_local_path": "/path/to/local/folder",
     "remote_path": "/path/on/remote/server/folder"
     }
  6. Run the script

    python transfer.py

SFTP Server Configuration on Oracle Linux

To set up SFTP server on Oracle Linux, follow these steps:

  1. Install openssh-server package

    sudo yum install openssh-server
  2. Edit the SSH server configuration file /etc/ssh/sshd_config and ensure the following settings:

    Subsystem sftp internal-sftp
    Match Group group-name
         ChrootDirectory /system-path/%u
         ForceCommand internal-sftp
         AllowTcpForwarding no
         X11Forwarding no
         PasswordAuthentication yes
  3. Create a group and add user to the group:

    sudo groupadd group-name
    sudo useradd -g group-name
  4. Restart the SSH service:

    sudo systemctl restart sshd
  5. Put script.sh to SFTP server so the program can hash files on the server:

    sftp user@server.ip.adress
    put script.sh
  6. Ensure proper routing between networks if your computer and server are not on the same network:

    You can test connectivity by attempting to connect the server using telnet from your computer:

    telnet your-server-ip your-server-port

    If telnet connection is successful, it indicates that routing is enabled and the server is listening on the specified port

About

Simple project for uploading and checking files integrity


Languages

Language:Python 97.3%Language:Shell 2.7%