Online Expert Day - HPE Data Storage - Live Now
April 24/25 - Online Expert Day - HPE Data Storage - Live Now
Read more
cancel
Showing results for 
Search instead for 
Did you mean: 

scp error.

SOLVED
Go to solution
fizan
Super Advisor

scp error.

when i am trying to login, through scp by giving username and password, after that it throws an error as
"Connection has been unexpectedly closed. Server sent command exit status 1."

can i know what is the error?
6 REPLIES
Steven E. Protter
Exalted Contributor

Re: scp error.

sftp and scp are supported by the same daemon.

You would need to check the logs on the server you are tying to connect to.

Possibilities:
1) Secure shell sshd daemon may need to restart.
2) Permissions or ownership problem on the .ssh directory or the files within or the user not owning its own home directory.

See the log file /var/adm/syslog/syslog.log

/sbin/init.d/secsh stop
/sbin/inig.d/secsh start
# This is a restart of the secure sell daemon

ll -d /home/username/.ssh
ll -d /home/username
ll /home/username/

The actual path to the user home directory may not be /home but its a good example.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
fizan
Super Advisor

Re: scp error.

# sftp maloy@20.20.50.110
Connecting to 20.20.50.110
Password:
Request for subsystem 'sftp' failed on channel 0
Connection closed

i tried with sftp its also throwing errror..

sorry i cant stop the ssh service . many users are using ssh logins.

what is the next step?
Steven E. Protter
Exalted Contributor
Solution

Re: scp error.

Shalom,

A quick restart will not disrupt your user base.

/sbin/init.d/secsh stop
/sbin/inig.d/secsh start
# This is a restart of the secure sell daemon


# This section can be checked with users on the system.
ll -d /home/username/.ssh
ll -d /home/username
ll /home/username/

/var/adm/syslog/syslog.log can be checked while users are on the system.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
fizan
Super Advisor

Re: scp error.

all the users are logind through ssh.. will thy sessions will not hangup . i am afraid of. better i will do by today nite the activity.. but for instant i copied thy file throuch rcp and uploaded but i need to check with scp.. i can connect all other servers through scp, only this hp-server i cant.. so thanks for your suggestions.
Steven E. Protter
Exalted Contributor

Re: scp error.

Shalom again,

It is possible the sessions will hang up.

I can not provide a guarantee.

I just logged on a Linux system using ssh, as root, and restarted the sshd daemon (/sbin/init.d/secsh on HP-UX.

I was not disconnected.

A quick restart usually does not disrupt user sessions. Again no guarantee.

I think though that since there are lots of happy users a restart of the daemon is not called for.

Investigating the log and permissions is a much better idea.

tail -f /var/adm/syslog/syslog.log

Then try a login with your user.

You might get enough diagnostics to isolate and solve the problem. Or post the results here.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
fizan
Super Advisor

Re: scp error.

thanks .