LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-23-2022, 04:45 AM   #1
petejc
Member
 
Registered: Apr 2019
Distribution: Slackware
Posts: 134

Rep: Reputation: Disabled
ssh - Slackware as server - seems like a chroot jail, but I don't want a chroot jail


I'm trying to ssh into my Slackware 15.0 desktop from my Slackware 15.0 laptop I find that I can list my home directory but I cannot see a lot of the root file system (permission denied) and also not run a large number of the commands. when I list my home directory I find user id 0, group id 0. Its almost like I have set up a chroot jail, but I have not. I can su to root and everything is normal as root. However, I've not tried setting up a chroot jail.

#ChrootDirectory none

Any suggestions? Googling give me lots of links for setting up a chroot jail, but not for removing unwanted chroot behaviour.
 
Old 10-23-2022, 04:55 AM   #2
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,461
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by petejc View Post
when I list my home directory I find user id 0, group id 0.
Odd. Are there files created by root in your user's home directory?

User 0 and group 0 generally refer to root.

Are you using the same user names on both devices?
 
Old 10-23-2022, 07:28 AM   #3
petejc
Member
 
Registered: Apr 2019
Distribution: Slackware
Posts: 134

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rkelsen View Post
Odd. Are there files created by root in your user's home directory?

User 0 and group 0 generally refer to root.

Are you using the same user names on both devices?
Yes, careful I am using the same user names with the same UID and GID on both. No (or few if any) files owned by root in the home directories. All were showing as owed by uid 0 gid 0. I need match user names, UID and GID as I want to sync my laptop to my desktop. I've been using unison to do this, with the home directory on my desktop mounted by nfs, but, being becoming aware that unison can use ssh for the connection it would be much neater to do it that way.
 
Old 10-23-2022, 08:12 AM   #4
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 976

Rep: Reputation: 664Reputation: 664Reputation: 664Reputation: 664Reputation: 664Reputation: 664
What if you don't ssh into your desktop but log in as the same normal user on the console? Does everything look normal then?

My guess is that you somehow have messed up permissions so that your normal user is unable to access the file /etc/passwd and /etc/group. Unable to map uid and gid numbers to user names and group names ls will display numeric id for user and group.

regards Henrik
 
1 members found this post helpful.
Old 10-23-2022, 08:13 AM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Anything unusual when using ssh with verbose options (-v or -vvv)?
 
Old 10-23-2022, 10:31 AM   #6
petejc
Member
 
Registered: Apr 2019
Distribution: Slackware
Posts: 134

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by henca View Post
What if you don't ssh into your desktop but log in as the same normal user on the console? Does everything look normal then?

My guess is that you somehow have messed up permissions so that your normal user is unable to access the file /etc/passwd and /etc/group. Unable to map uid and gid numbers to user names and group names ls will display numeric id for user and group.

regards Henrik
Henrik,

that was it. I must have updated a package when sudo'ed into root somehow as that seems to pick up my user umask and not use roots. So large areas of the filesystem were not readable by anyone but root. I just happened to notice it when trying to log in first via ssh. I think I've manually fixed it but it is tempting to go back to a snapshot and re-run any updates.

Pete
 
Old 10-23-2022, 04:11 PM   #7
glorsplitz
Senior Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 1,310

Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
Quote:
Originally Posted by henca View Post
Unable to map uid and gid numbers to user names and group names ls will display numeric id for user and group.
Thank you, I was wondering about that.
 
Old 10-24-2022, 12:55 AM   #8
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 976

Rep: Reputation: 664Reputation: 664Reputation: 664Reputation: 664Reputation: 664Reputation: 664
Quote:
Originally Posted by glorsplitz View Post
Thank you, I was wondering about that.
This can also happen even if you are able to read /etc/passwd or /etc/group if those numeric uid and gid are missing in /etc/passwd and /etc/group. The file system might have been created on another machine with other/more contents in those files.

regards Henrik
 
  


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
I'm defeated: Can't get SCP to work in chroot jail (but sftp and ssh work fine) ponga Linux - Security 2 09-30-2011 11:06 AM
[SOLVED] Chroot jail or Root jail bayprince Linux - Newbie 3 07-25-2011 07:43 PM
[SOLVED] chroot jail problem: 'empty' jail MatrixS_Master Linux - Security 4 03-27-2010 06:25 AM
slackware 10.2 chroot/jail ssh zdannar Slackware 3 07-12-2007 05:51 PM
ssh session in a chroot jail? houler Linux - Security 13 04-05-2005 01:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:32 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