LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-06-2010, 02:09 PM   #1
ily96
LQ Newbie
 
Registered: Jan 2010
Posts: 5

Rep: Reputation: 0
SSH Reinstall / SCP & SFTP


Hello,

The last fews weeks, I've been having issues using SSH on
one of our servers.

I can't think of any changes to the system - no updates, etc...
OS - Linux version 2.6.18-4-686 (Debian 2.6.18.dfsg.1-12etch2)

I received the following error when trying to use SCP or SFTP -
command-line: line 0: Bad configuration option: PermitLocalCommand

I looked at the sshd_config file and it was edited on 12/12. I did not
edit the file and no one else has access to this server (at least, no
one officially has access). Every line in the config was commented out.
I tried adding PermitLocalCommand and uncommenting the config file, but to
be honest I'm not sure what needed uncommented. After researching the
error for a few days on google, I tried to uninstall and reinstall SSH.
The uninstall went fine, but when reinstalling I receive the following
error -

Unpacking openssh-client (from .../openssh-client_1%3a4.3p2-9etch3_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/openssh-client_1%3a4.3p2-9etch3_i386.deb (--unpack):
unable to make backup link of `./usr/bin/scp' before installing new version: Operation not permitted
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Selecting previously deselected package openssh-server.
Unpacking openssh-server (from .../openssh-server_1%3a4.3p2-9etch3_i386.deb) ...
Selecting previously deselected package ssh.
Unpacking ssh (from .../ssh_1%3a4.3p2-9etch3_all.deb) ...
Errors were encountered while processing:
/var/cache/apt/archives/openssh-client_1%3a4.3p2-9etch3_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried to change permissions on the bin file, as root, but receive
chmod: changing permissions of `/usr/bin/scp': Operation not permitted

Any suggestions would be greatly appreciated.

Thank You,

Ily
 
Old 01-06-2010, 02:16 PM   #2
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 48
Please post the output of

Code:
ls -l /usr/bin/scp
Thanks.
 
Old 01-06-2010, 02:20 PM   #3
ily96
LQ Newbie
 
Registered: Jan 2010
Posts: 5

Original Poster
Rep: Reputation: 0
-rwxr-xr-x 1 root root 43568 2008-09-15 15:57 /usr/bin/scp

Thank You.
 
Old 01-06-2010, 02:43 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
And the output of 'mount'?
 
Old 01-06-2010, 02:47 PM   #5
ily96
LQ Newbie
 
Registered: Jan 2010
Posts: 5

Original Poster
Rep: Reputation: 0
I wasn't sure what command you wanted to me to use -

If I try to mount the partition /usr/ is on I get the following -

mount /dev/sda2
mount: /dev/sda2 already mounted or /usr busy
mount: according to mtab, /dev/sda2 is already mounted on /usr

If there is a different command I should be using, please let
me know. Thanks
 
Old 01-06-2010, 02:55 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Just run mount on its own, w/o any parameters. I'd like to
see the options with which the filesystem has been mounted.
 
Old 01-06-2010, 03:10 PM   #7
ily96
LQ Newbie
 
Registered: Jan 2010
Posts: 5

Original Poster
Rep: Reputation: 0
/dev/sda1 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/sda7 on /home type xfs (rw,usrquota,grpquota)
/dev/sda6 on /tmp type ext3 (rw)
/dev/sda2 on /usr type ext3 (rw)
/dev/sda3 on /var type ext3 (rw)

Thanks for the follow up
 
Old 01-06-2010, 03:46 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
So it's not a mount-option that denies the permission.

What about an lsattr on the file-system? What user are
you doing this all as?
 
Old 01-06-2010, 04:10 PM   #9
ily96
LQ Newbie
 
Registered: Jan 2010
Posts: 5

Original Poster
Rep: Reputation: 0
lsattr -v -d /usr/bin/scp
914888470 s---ia------------ /usr/bin/scp

lsattr -v -d /dev/sda2
lsattr: Operation not supported While reading flags on /dev/sda2

Thank you SO much! I wasn't aware of the lsattr command, however, when I went to man
the entry before issuing the command I became aware of 'chattr'. Which lead me to
remove the option that apt could not change/modify the file. Again, thank you.
I've successfully reinstalled ssh and all is working well!
 
Old 01-06-2010, 04:12 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Awesome - well do; glad I could be of some assistance ;}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Chroot SSH problem: ssh working, not SFTP & SCP. NaCo Linux - Security 3 02-01-2009 02:23 AM
allow ssh, scp and sftp? javier_ccs Linux - Newbie 6 09-12-2006 08:11 AM
SFTP with Chrooting and without SSH and SCP toraghun Linux - Security 1 07-10-2006 05:11 AM
SSH - where are scp and sftp satimis Linux - Networking 2 11-15-2003 10:27 AM
ssh working, but not sftp scp hardigunawan Linux - Networking 2 05-02-2003 02:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration