sshd (openssh) on SunOS without root privileges


 
Thread Tools Search this Thread
Operating Systems Solaris sshd (openssh) on SunOS without root privileges
# 1  
Old 03-13-2008
sshd (openssh) on SunOS without root privileges

Hi, I've just managed to install openssh in my home directory on a server I have access to by using --prefix=$HOME/local after ./configure. Another thing I was having trouble with without root access was privilege separation, so I disabled that in my sshd_config. However, when I run ~/local/sbin/sshd, nothing happens. There is no mention of sshd in the process list either. Is it because I can't start a server from my home directory when there is already one running from the root directory?

The reason why I'm trying to do all this is that I want to use this server as a "middleman" to run a reverse tunnel to my home machine which is behind a NAT firewall, so that I can connect to my home machine from anywhere thru the middleman, as described here.

Anyone have any suggestions?
# 2  
Old 03-13-2008
Did you change the listen port to a non privileged one ?
# 3  
Old 03-13-2008
Yeah, I used 10000, like in the tutorial, which is > 1024. But besides, if I can't even start my sshd server, nothing will work, rght?
# 4  
Old 03-13-2008
What version of Solaris is it?
# 5  
Old 03-13-2008
and what says "sshd -de" ?
# 6  
Old 03-13-2008
OK, I think I'm getting somewhere....

I changed the ports in ssh_config and sshd_config to 10003 from 22. Then sshd -de gave me:

debug1: sshd version OpenSSH_4.7p1
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #1 type 2 DSA
debug1: setgroups() failed: Not owner
debug1: rexec_argv[0]='/home/shay/a/yeo/local/sbin/sshd'
debug1: rexec_argv[1]='-de'
debug1: Bind to port 10003 on ::.
Server listening on :: port 10003.
debug1: Bind to port 10003 on 0.0.0.0.
Server listening on 0.0.0.0 port 10003

then I did
user@destination$ ssh -R 10000:localhost:10003 middleuser@middle
from my home machine (destination)

then I did
user@remote$ ssh destinationuser@middle -p 10000
from a remote machine, and on the terminal which I ran sshd -de, this appears:
debug1: fd 6 clearing O_NONBLOCK
debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 6 out 6 newsock 6 pipe -1 sock 11
debug1: sshd version OpenSSH_4.7p1
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #1 type 2 DSA
debug1: setgroups() failed: Not owner
debug1: inetd sockets after dupping: 4, 4
Connection from 128.210.10.101 port 39851
debug1: Client protocol version 2.0; client software version OpenSSH_4.6
debug1: match: OpenSSH_4.6 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.7
debug1: list_hostkey_types: ssh-rsa,ssh-dss
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST received
debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT
debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: KEX done
debug1: userauth-request for user yeo service ssh-connection method none
debug1: attempt 0 failures 0
Failed none for yeo from 128.210.10.101 port 39851 ssh2
debug1: userauth-request for user yeo service ssh-connection method keyboard-interactive
debug1: attempt 1 failures 1
debug1: keyboard-interactive devs
debug1: auth2_challenge: user=yeo devs=
debug1: kbdint_alloc: devices ''
Failed keyboard-interactive for yeo from 128.210.10.101 port 39851 ssh2
debug1: userauth-request for user yeo service ssh-connection method password
debug1: attempt 2 failures 2
Could not get shadow information for yeo
Failed password for yeo from 128.210.10.101 port 39851 ssh2

It seems I'm almost there except my server doesn't recognize the username that's SSHing in........
Oh, and the solaris running is version 10. Thanks for your help so far!
# 7  
Old 03-13-2008
OK, I realized, I was doing some things wrong and I fixed them, and this is what I have now: after doing
~/local/sbin/sshd -de
I get:
Code:
debug1: sshd version OpenSSH_4.7p1
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #1 type 2 DSA
debug1: setgroups() failed: Not owner
debug1: rexec_argv[0]='/home/shay/a/yeo/local/sbin/sshd'
debug1: rexec_argv[1]='-de'
debug1: Bind to port 10003 on ::.
Server listening on :: port 10003.
debug1: Bind to port 10003 on 0.0.0.0.
Server listening on 0.0.0.0 port 10003.

Then from my home machine I do
$ ssh -R 10000:localhost:22 -p 10003 user@middle
and the middle shows:
Code:
debug1: fd 6 clearing O_NONBLOCK
debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 6 out 6 newsock 6 pipe -1 sock 11
debug1: sshd version OpenSSH_4.7p1
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #1 type 2 DSA
debug1: setgroups() failed: Not owner
debug1: inetd sockets after dupping: 4, 4
Connection from 72.12.198.89 port 2477
debug1: Client protocol version 2.0; client software version OpenSSH_4.7
debug1: match: OpenSSH_4.7 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.7
debug1: list_hostkey_types: ssh-rsa,ssh-dss
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST received
debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT
debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: KEX done
debug1: userauth-request for user yeo service ssh-connection method none
debug1: attempt 0 failures 0
Failed none for yeo from 72.12.198.89 port 2477 ssh2
debug1: userauth-request for user yeo service ssh-connection method publickey
debug1: attempt 1 failures 1
debug1: test whether pkalg/pkblob are acceptable
debug1: temporarily_use_uid: 166946/1 (e=166946/1)
debug1: trying public key file /home/shay/a/yeo/.ssh/authorized_keys
debug1: matching key found: file /home/shay/a/yeo/.ssh/authorized_keys, line 1
Found matching RSA key: xxxxxxxxxxxxxxx........
debug1: restore_uid: (unprivileged)
Postponed publickey for yeo from 72.12.198.89 port 2477 ssh2
debug1: userauth-request for user yeo service ssh-connection method publickey
debug1: attempt 2 failures 1
debug1: temporarily_use_uid: 166946/1 (e=166946/1)
debug1: trying public key file /home/shay/a/yeo/.ssh/authorized_keys
debug1: matching key found: file /home/shay/a/yeo/.ssh/authorized_keys, line 1
Found matching RSA key: xxxxxxxxxxxxxxx........
debug1: restore_uid: (unprivileged)
debug1: ssh_rsa_verify: signature correct
Accepted publickey for yeo from 72.12.198.89 port 2477 ssh2
debug1: Entering interactive session for SSH2.
debug1: server_init_dispatch_20
debug1: server_input_global_request: rtype tcpip-forward want_reply 1
debug1: server_input_global_request: tcpip-forward listen localhost port 10000
debug1: Local forwarding listening on :: port 10000.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 0.0.0.0 port 10000.
debug1: channel 1: new [port listener]
debug1: server_input_channel_open: ctype session rchan 0 win 1048576 max 16384
debug1: input_session_request
debug1: channel 2: new [server-session]
debug1: session_new: init
debug1: session_new: session 0
debug1: session_open: channel 2
debug1: session_open: session 0: link with channel 2
debug1: server_input_channel_open: confirm session
debug1: server_input_channel_req: channel 2 request pty-req reply 0
debug1: session_by_channel: session 0 channel 2
debug1: session_input_channel_req: session 0 req pty-req
debug1: Allocating pty.
debug1: session_pty_req: session 0 alloc /dev/pts/10
debug1: server_input_channel_req: channel 2 request shell reply 0
debug1: session_by_channel: session 0 channel 2
debug1: session_input_channel_req: session 0 req shell
debug1: Setting controlling tty using TIOCSCTTY.

then from a remote machine I do
ssh destinationuser@middle -p 10000
and the middle shows
Code:
debug1: Connection to port 10000 forwarding to localhost port 0 requested.
debug1: channel 3: new [forwarded-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: forwarded-tcpip: listening port 10000 for localhost port 0, connect from 128.210.10.101 port 40031, nchannels 4

while the remote terminal shows
Code:
ssh_exchange_identification: Connection closed by remote host

I've done everything in the guide correctly and I'm out of ideas right now...does anyone have any suggestions? thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Can you gain root privileges if the suid program does not belong to root?

I had a question in my test which asked where suppose user B has a program with 's' bit set. Can user A run this program and gain root privileges in any way? I suppose not as the suid program run with privileges of owner and this program will run with B's privileges and not root. (1 Reply)
Discussion started by: syncmaster
1 Replies

2. HP-UX

User with root privileges in hp ux

hi, i am new in hp ux and i must create a user with root privileges and so i disable ssh connection from root login. thanks.. (6 Replies)
Discussion started by: eliste
6 Replies

3. Solaris

Gaining root privileges

Hello I am a new (and only) administrator of a Solaris 10 environment. The previous admin gave me a use (say user123) that is supposed to have administrative privileges. Now the problem is, the user does not have this privilege! Here is what i tried so far: $ id uid=109(user123) gid=1(other)... (3 Replies)
Discussion started by: abohmeed
3 Replies

4. Shell Programming and Scripting

Privileges like root

My English is no very good. I must make a bash scripting sh create like a backdoor, and when execute the script a user without privileges convert in super user or root, whithout introducing the password. In Spanish: Crear un script que sirva como puerta trasera al sistema, de manera que al... (1 Reply)
Discussion started by: kitievbr
1 Replies

5. Linux

grant root privileges to ordinary user

Hi, Is it possible to grant root privileges to an ordinary user? Other than 'sudo', is there some way under Users/Groups configuration? I want ordinary user to be able to mount, umount and use command mt. /Brendan (4 Replies)
Discussion started by: brendan76
4 Replies

6. UNIX for Dummies Questions & Answers

root privileges

Hello, As admin with root rights, to execute any command from another user without password-ask, I do : su - <user> -c "<cmd>" But how can I do to give the same rights to another physical user without using root user ? :confused: I've try to create another user "toor" with the same primary... (4 Replies)
Discussion started by: madmat
4 Replies

7. Solaris

running sshd server from home directory without root access

Hi, I managed to install openssh from source on my home directory on a server I don't have root access to. I had problems with privilege separation because of permissions initially so I disabled it in sshd_config. But when I run sshd from where I installed it by doing ~/local/sbin/sshd, nothing at... (0 Replies)
Discussion started by: sayeo
0 Replies

8. IP Networking

Change the root directory for apache, sshd and ftpd

Helo ! I want to do something and I don't know where to start... I want to make a small web hosting server (just for me and a few friends) and for the sake of learning I'd like to make an account for every user. The thing is that I want everyone to log into the server and to be put in his home... (3 Replies)
Discussion started by: Sergiu-IT
3 Replies

9. Programming

root privileges

Hi I have make a program that needs root privleges but any user can try to run it, so what I want it is, when any user tries( other than root ) to run the program, an input prompt would open to enter root password ( if user knows ) and program will run ( otherwise exit ), and after completing... (21 Replies)
Discussion started by: sumsin
21 Replies

10. UNIX for Dummies Questions & Answers

Root privileges &Sudoer

Hi guys... how can a root assign a user all or most of the root privileges? is sudoer comand enough 4 this? thx alot.. (2 Replies)
Discussion started by: blue_7
2 Replies
Login or Register to Ask a Question