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

Reply

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.

Reply

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 192.168.0.110 -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 192.168.0.130 port 36633
Failed none for myusername from 192.168.0.130 port 36633 ssh2
Accepted password for myusername from 192.168.0.130 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.

Reply

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.

cheers,
agrd_sn

Reply

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

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

Reply

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

Reply

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

Reply

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

Reply

9 Apu May 7, 2011 at 2:28 pm

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

Reply

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?

Reply

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.

Reply

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.

Reply

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

Reply

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

Reply

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?

Reply

Leave a Comment

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

Previous post:

Next post: