Tag Info

New answers tagged

2

You can try mounting the folder as a BIND in the users' home directories. For user foo: # mkdir -p /home/foo/Update /home/foo/GameConfig # mount --bind /var/www/Update/ /home/foo/Update # mount --bind /root/gamed/config /home/foo/GameConfig And in your /etc/fstab, you can add /var/www/Update /home/foo/Update bind defaults,bind 0 0 ...


6

You need to add ForceCommand internal-sftp after Match User user_www line. This forces OpenSSH to use its internal sftp implementation instead of trying to execute the external sftp-server command, which cannot be accessed from inside the chroot jail.


-4

SFTP will also use data ports at higher ranges. SSH will remain the control port. It uses more than 22 in most instances...


2

If user u2 only needs to access /home/u1/public_html/site1 via SFTP and is not allowed to access the system in any other way: you can give him that directory as a home directory and follow normal chroot procedures. Alternatively : A Linux bind mount allows you to map one part of an existing file system to a second location in your directory tree. Bind ...


1

The below script was tested on CentOS 6.5. Walks through the files under a specified folder and adds them one by one to zip file(s) no bigger than a specified max-size. Adding files to a zip one at a time can cause CPU or Storage I/O spikes: #!/bin/bash files_folder="/home/username/public_html/" zip_folder="/home/username/" zip_maxsize=524288000 # ...


0

I have found a simple solution. First I made a list of all folders I need to zip: ls > list.txt Than I removed ./ and ../ from the list. After that I have split that list with text editor into 5 different files, e.g. listPart1, listPart2, listPart3 ... I put those lists in the folder that contains all folders that need to be zipped and I ran this ...


2

Sorry I dont have a new enough cred to just comment. But something like this should help you with the zipping of the folders. #! /bin/bash DIR=$1 i=0 arr=() zipnum=0 cd $DIR for item in * do if [[ -d $item ]]; then if [ $i -lt 2 ]; then arr+=($item) ((i++)) else ...


1

Rather than trying to loosen security with a group rule, I'd use the default security and tighten with group rules. Here's an example that requires 2factor authentication for users, but not sftp-users. # Only these groups can connect AllowGroups users sftp-users Match Group users RequiredAuthenticatios2 publickey,keyboard-interactive Match Group ...


2

The exact one that has to be enabled is: setsebool -P ssh_chroot_rw_homedirs on I struggled with that for 2 days before I got that!!


0

You can use ssh port forward for archive this ssh -L localportinmypc:hostname_of_the_behind_the_firewall:remoteport hostname_of_my_firewall Now after this: sftp -o Port=localportinmyp localhost or ssh -p localportinmyp


2

The OpenSSH sshd_config manual is pretty clear about the requirements for the chroot directory: ChrootDirectory Specifies the pathname of a directory to chroot(2) to after authentication. All components of the pathname must be root- owned directories that are not writable by any other user or group. If you want ...


2

I'm guessing you don't have backups so. First thing to check is if there is a /etc/ssh/sshd_config.rpmnew, if there is it's an original as supplied sshd_config simply copy it over sshd_config and restart the service. On CentOS you can use rpm to find which package the /etc/ssh/sshd_config file is in e.g. rpm -qf /etc/ssh/sshd_config ...


1

In you client side, try ssh-add command before (one time only) start the sftp session



Top 50 recent answers are included