Link to home
Start Free TrialLog in
Avatar of itnifl
itniflFlag for Norway

asked on

Open SSH server permitting sftp connection for one user but not the other

I have a Open SSH server permitting sftp connection for one user but not the other. I don't know why this is happening. Both are regular users and both work fine logging on via ssh. Here is the config:

Port 22
Protocol 2

HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key

UsePrivilegeSeparation yes

KeyRegenerationInterval 3600
ServerKeyBits 768

SyslogFacility AUTH
LogLevel INFO


LoginGraceTime 120
PermitRootLogin no
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes

IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no

X11Forwarding no
X11DisplayOffset 10
PrintMotd no

PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of gheist
gheist
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Steven Vona
Steven Vona
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of itnifl

ASKER

gheist: Both the user that can connect and the user that cannot connect seem able to execute /usr/lib/openssh/sftp-server. When logged in with both users, the command prompt halts when executing these and resumes only when I press Ctrl-C.

savone: I log in with password, but if there are keys, how would I check this? The user that cannot connect via sftp is a new user by the way, just added to the system.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of itnifl

ASKER

Here is the difference in group memberships:
user1@Ubu-DR1:~$ more /etc/group | grep user1
adm:x:4:user1
cdrom:x:24:user1
sudo:x:27:user1
dip:x:30:user1
plugdev:x:46:user1
sambashare:x:112:user1
user1:x:1000:
lpadmin:x:114:user1
sftpusers:x:1003:user2,user1
LocalSSHGroup:x:1004:user1

user1@Ubu-DR1:~$ more /etc/group | grep user2
users:x:100:user2
sftpusers:x:1003:user2,user1
user2:x:1002:

Open in new window


Or this way if you like:
user1@Ubu-DR1:~$ id user1
uid=1000(user1) gid=1000(user1) groups=1000(user1),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),112(sambashare),114(lpadmin),1003(sftpusers),1004(LocalSSHGroup)

user1@Ubu-DR1:~$ id user2
uid=1001(user2) gid=1002(user2) groups=1002(user2),100(users),1003(sftpusers)

Open in new window


I am testing for both users using WinSCP. File protocol chosen in both cases is the same, SFTP.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of itnifl

ASKER

WinSCP is version 5.1.3.2881. There is no Plink.exe under the WinSCP installation folder or subfolders. I found the file randomly on my system under some homework files from when I was in school, but doupt that the path to this location is in my environment variable paths. The version of that file is 0.60. If the version was the problem it should fail no matter what user I connect with, but that is not the case.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of itnifl

ASKER

Pageant.exe and puttygen.exe under WinSCP\PuTTY is version 0.62
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of itnifl

ASKER

C:\Windows\system32>plink -v c:\fileA.txt host:/tmp/xxx
'plink' is not recognized as an internal or external command,
operable program or batch file.

Like I told you, plink.exe is not in my paths variable on my windows client and is not under the WinSCP installation.
Avatar of itnifl

ASKER

I have a terrible confession to make. The real source of the problem is that user1's real username is terribly long, and in this long username was a typo :) the typo was only in the WinSCP profile, that is why everything was working fine with SSH where the username as typed correctly.

Sorry about that guys. You are all receiving points for participating.
Is there any reason you cannot download it to confirm it is not a client issue? It is tough to know what is going on without logging.
Avatar of itnifl

ASKER

Typo again, user2's user name is terribly long - not user1.
No problem, didn't see your previous post.