Tag Info

Hot answers tagged

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!!


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

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 ...


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 # ...


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 ...


1

ForceCommand internal-sftp You won't be able to ssh into the system if you are forcing internal-sftp. You likely have other configuration problems too for instance I expect you're not meeting the file user:group ownership requirements - from the documentation ... ChrootDirectory Specifies a path to chroot(2) to after ...


1

Setting up chroot for general SSH access is a lot more difficult than setting up chroot for just SFTP. The "internal-sftp" feature doesn't require the SSH server to launch any external programs, so the chroot environment doesn't have to support running external programs. To provide general SSH access, you have to configure the chroot environment with ...


1

Exit code 126 is the bash error code for a command that was found but couldn't be executed. See here and here. For example: $ /dev/null -bash: /dev/null: Permission denied $ echo $? 126 When you're not forcing internal-sftp, OpenSSH server uses a program called sftp-server to handle remote SFTP sessions. My guess is that the sftp-server program on this ...


1

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


1

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 ...



Only top voted, non community-wiki answers of a minimum length are eligible