Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've setup TCP forwarding over SSH using the following command:

ssh -N -L 1234:10.0.2.2:1234 root@10.0.2.1

This works no problem. So I decided to create a non-root account user1 on 10.0.2.1 to do this in a more secure/safer way. However, I get a permission denied error message when I try to the same command with the user1 account.

share|improve this question
2  
Are you confident that the error relates to the port forward operation, have you ensured the user can use ssh? –  Tim Jul 25 '12 at 17:53
1  
Is there any "Match User ...." directives in your sshd_config? –  Tim Jul 25 '12 at 17:54
    
Aha! Thanks Tim - there was an entry in the sshd_config which was screwing things up. –  please delete me Jul 25 '12 at 18:03
    
Can you post the solution below? –  Michael Mrozek Jul 25 '12 at 18:13
    
@JimR No problem, glad it worked! –  Tim Jul 25 '12 at 18:29
show 1 more comment

1 Answer

up vote 5 down vote accepted

Some distro's come with a premade sshd_config that has separate permissions based on a username or group, example:

Match User anoncvs
       X11Forwarding no
       AllowTcpForwarding no
       ForceCommand cvs server

Jim most likely resolved this by commenting out, or adjusting the directive to match the permissions he needed.

More info available via man sshd

share|improve this answer
    
That's useful to know - I'm not too familiar with the 'Match' syntax, but I guess it speaks for itself. –  please delete me Jul 25 '12 at 18:54
    
I just commented this out as you said. –  please delete me Jul 25 '12 at 18:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.