{ 15 comments… read them below or add one }

1 Pinoy Compuworld April 24, 2008 at 5:58 am

This article is a life saver. I am a freeBSD sysad but was forced to use centos! thanks man! im subscribing to your RSS Feeds!


2 Shubhendu June 25, 2008 at 7:47 am

I want to transfer file to other machine using
scp or sftp. How can I use the scp or sftp in my
shell script so that the system takes the password for sftp automatically.


3 stan July 3, 2008 at 4:14 pm

Nice tutorial!

I was just happy that I found what I needed, but it seems there’s somethig that I’m missing.

I need user friendly interface to upload/dowload files (for my friends) and rsync (for me :) ). So I uncommented “allowscp”, “allowsftp” and “allowrsync”. I tested ssh, scp and sftp in console and everythig worked as expected, but when I tried to connect with gFTP (I’m using Ubuntu Hardy) and selected SSH2 connection, I was available to browse the direcroties below my user’s home dir. In that case rssh is not really “restricted”. Is this some bug?

gFTP connects to the remote host with “ssh -e none -l myusername -s sftp”. When I type it in the console and enter the password, the cursor blinks on the next row until I press Ctrl+C. In the auth.log says:
Connection from port 36633
Failed none for myusername from port 36633 ssh2
Accepted password for myusername from port 36633 ssh2
pam_unix(sshd:session): session opened for user myusername by (uid=0)
subsystem request for sftp

I’ll make a post in ubuntuforums.org, but tought it will be usefull for others if we find what’s the reason for this behaviour.

I would preffer using rssh whithout chroot, so please help me solve this issue.


4 agrd_sn November 19, 2010 at 7:50 am

i use filezilla and got this error:
Error: Connection closed by server with exitcode 128
Error: Could not connect to server
how to resolv this problem?
thx b4.



5 Esteban du Plantier January 17, 2011 at 7:34 pm

Nope, you need to add the user account to the rsshusers group :-)
ls -la /usr/bin/rssh
-rwxr-x— 1 root rsshusers 22276 Nov 4 16:27 /usr/bin/rssh


6 agrd_sn November 19, 2010 at 7:56 am

i’ve found it.
i add permission (x) for others to execute /usr/bin/rssh


7 Sanchit January 17, 2013 at 5:36 pm

i am facing similar problem which you were facing ?how did you resolve it.
Error: Connection closed by server with exitcode 128
Error: Could not connect to server


8 Apu May 7, 2011 at 2:25 pm

where do i can get the rssh package and what i have to do at /usr/bin/rssh file


9 Apu May 7, 2011 at 2:28 pm

rssh package is available at http://packages.sw.be/rssh/


10 Shells October 10, 2011 at 8:48 pm

If I try to connect over ssh, I get an immediate Connection Closed. On Filezilla, I get exitcode 1. Any ideas?


11 Shells October 10, 2011 at 8:50 pm

Actually, to clarify: Over ssh, I get an “account restricted by ssh” message, allowed commands: scp sftp. And then a connection closed.


12 nixCraft October 11, 2011 at 2:45 pm

It means, shell access is not allowed. You can only upload or download files using sftp/scp client.


13 mro December 2, 2012 at 12:29 am

i also have this exitcode 1 issue.

i can not connect successfully with sftp

Command: open “USER@DOMAIN” 22
Command: Pass: ********
Status: Connected to DOMAIN
Error: Connection closed by server with exitcode 1
Error: Could not connect to server

when i login via ssh i get this exitcode error and it disconnects


14 John December 1, 2011 at 1:47 am

Thanks, I was getting the connection closed error and adding the user to rsshusers worked!

/usr/sbin/usermod -a -G rsshusers username


15 bharat June 22, 2012 at 6:56 am

Hi Vivek,

I have created account by rssh and then applied chroot by your article: http://www.cyberciti.biz/tips/howto-linux-unix-rssh-chroot-jail-setup.html
And also have allowscp & allowsftp flags un-commented.

But then when I try to scp I get following error:
unknown user 504
Any idea?


Leave a Comment

Tagged as: , , , , , , , , , , , ,

Previous post:

Next post: