How To
Summary
This technote describes the recommended method for configuring a chroot environment for sftp on AIX®.
Steps
usw stanza in login.cfg.
chsec -f /etc/security/login.cfg -s usw -a `lssec -f /etc/security/login.cfg -s usw -a shells | awk '{print $2}'`,/usr/sbin/sftp-server
mkdir -p /sftp/sftproot chown -R root:system /sftp chmod -R 700 /sftp
admin = false. This attribute can be found by running lsgroup on the group. The following command sets admin = false automatically when it creates the group.mkgroup sftpgrp
su=false shell=/usr/sbin/sftp-server login=false home=/sftp/sftproot/<user> pgrp=sftpgrp rlogin=false
chuser "su=false" "shell=/usr/sbin/sftp-server" "login=false" "home=/sftp/sftproot/<existing_user>" "pgrp=sftpgrp" "rlogin=false" <existing_user>
ADMCHG flag from it with the following command.pwdadm -c <user>
chown root:sftpgrp /sftp/sftproot/<user> chmod 750 /sftp/sftproot/<user>
sftp-server program requires that it must be owned by the user and the sftp group, and have 700 permissions. The writable directory must be a subdirectory of the user's home directory. It cannot be the home directory itself.mkdir /sftp/sftproot/<user>/writeabledir chown <user>:sftpgrp /sftp/sftproot/<user>/writeabledir chmod 700 /sftp/sftproot/<user>/writeabledir
/etc/ssh/sshd_config file.Match Group sftpgrp ChrootDirectory %h ForceCommand internal-sftp AllowTcpForwarding no PermitTunnel no X11Forwarding no
stopsrc -s sshd startsrc -s sshd
Additional Information
|
SUPPORT: If the instructions in this document do not lead to resolution of the problem, follow these instructions to open a case. The product must be under warranty or have an active and valid support contract. a. Document or take screen captures of all symptoms, errors, or messages. b. Capture any logs or data relevant to the issue. c. Contact IBM® to open a case. -For electronic support, visit the IBM Support Community: d. Provide a detailed description of the issue and reference this technote. e. Upload all of the details and data to the case. -You can attach files to the case in the IBM Support Community, or http://www.ibm.com/support/docview.wss?uid=ibm10733581 f. Click here to submit feedback for this document. |
Was this topic helpful?
Document Information
Modified date:
22 September 2022
UID
ibm10734507