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.
-
Ensure you have Python installed on your system
-
Clone this repository:
git clone https://github.com/elenadj7/securetransfer.git
-
Navigate to the project directory:
cd securetransfer
-
Install Paramiko:
pip install paramiko
-
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" }
-
Run the script
python transfer.py
To set up SFTP server on Oracle Linux, follow these steps:
-
Install
openssh-server
packagesudo yum install openssh-server
-
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
-
Create a group and add user to the group:
sudo groupadd group-name sudo useradd -g group-name
-
Restart the SSH service:
sudo systemctl restart sshd
-
Put
script.sh
to SFTP server so the program can hash files on the server:sftp user@server.ip.adress put script.sh
-
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