Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sftp account with chroot

Status
Not open for further replies.

oraytektips

Programmer
Jul 1, 2005
65
0
0
US
I created a new sftp accont with the new chroot facility in ssh.But when I login it doesn't take me the right directory.
tail /etc/ssh/sshd_config

Subsystem sftp internal-sftp
Match User sftptest
ChrootDirectory /temp
AllowTcpForwarding no
X11Forwarding no
ForceCommand internal-sftp

when I login using sftptest
sftptest@server's password:
sftp> pwd
Remote working directory: /
sftp> cd ftp
sftp> pwd
Remote working directory: /ftp

how can I directly go to /temp/ftp when I login without
doing cd ftp?

Thanks!
 
I'm trying to set up a simple chroot sftp as well and having an issue.

# ssh -v
OpenSSH_5.0p1, OpenSSL 0.9.8h 28 May 2008

# tail /etc/ssh/sshd_config

# override default of no subsystems
Subsystem sftp internal-sftp

# Example of overriding settings on a per-user basis
Match User ftptest
ChrootDirectory /chroot
AllowTcpForwarding no
X11Forwarding no
ForceCommand internal-sftp


Then when I try to connect from another machine I put in my password and get connection closed and I'm not sure why?

debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending subsystem: sftp
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.0 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 255
Connection closed

any suggestions on why this isn't working?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top