LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-27-2016, 01:05 PM   #31
RobInRockCity
Member
 
Registered: Feb 2015
Posts: 141

Original Poster
Rep: Reputation: Disabled

Quote:
Originally Posted by suicidaleggroll View Post
That said, I don't understand the question. What can't you see in the terminal? There's no directory structure or file where? Best guess at interpreting your question is that you're confused about the difference between relative and absolute paths:
http://www.linuxnix.com/abslute-path...-in-linuxunix/
cliffordw and you recommended this command to get the fingerprint from my server...
Code:
ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub

If I ssh into my server I end up here...
Code:
vps-user@mydomain.com [~] #
If I type ls at that prompt I see lots of directories including etc/

If I then type...
Code:
cd etc/

ls
then I see this...
Code:
./  ../  cacheid  mydomain.com/
There is no path: /etc/ssh/ssh_host_rsa_key.pub


And even if I look in the directory: mydomain.com/ I don't see anything in it.


So I concur - and thank you guys - for the command to get the fingerprint for my server, but am curious why that command works when I don't see that directory structure or file in my VPS account.

See?
 
Old 02-27-2016, 01:10 PM   #32
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,896

Rep: Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921
not etc but /etc (probably)
 
Old 02-27-2016, 01:29 PM   #33
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,561

Rep: Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127
I repeat:
Best guess at interpreting your question is that you're confused about the difference between relative and absolute paths:
http://www.linuxnix.com/abslute-path...-in-linuxunix/

"etc" is a relative path that depends on your current location. "/etc" is an absolute path that does not depend on your current location. Unless you are currently sitting in "/", they are not the same directory. Please read the link.
 
Old 02-27-2016, 02:58 PM   #34
RobInRockCity
Member
 
Registered: Feb 2015
Posts: 141

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
I repeat:
Best guess at interpreting your question is that you're confused about the difference between relative and absolute paths:
http://www.linuxnix.com/abslute-path...-in-linuxunix/
I read that. Would be nice if you'd read what I said and help me figure out where I am stuck.

Quote:
Originally Posted by suicidaleggroll View Post
"etc" is a relative path that depends on your current location. "/etc" is an absolute path that does not depend on your current location. Unless you are currently sitting in "/", they are not the same directory. Please read the link.
Why do you seemingly read and response to every other thing I say? Come on, man.

I said above...
Quote:
There is no path: /etc/ssh/ssh_host_rsa_key.pub
Looks like an absolute path to me...

Would be nice if people answer my questions instead of talking around them...

Last edited by RobInRockCity; 02-27-2016 at 03:03 PM.
 
Old 02-27-2016, 03:41 PM   #35
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,561

Rep: Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127
If the command ran without error, like you said it did, then the file does exist.

Run the following to see it:
Code:
ls -l /etc/ssh/ssh_host_rsa_key.pub
If you can't find it while navigating the directory structure, the only explanation is you don't understand relative vs absolute paths. Your example above shows you going to the "etc" subdirectory of your user's home directory, something like /home/vps-user/etc/, which is of course not the same place as /etc. You can always use the command "pwd" to see where you currently are.

Last edited by suicidaleggroll; 02-27-2016 at 03:50 PM.
 
Old 02-27-2016, 05:27 PM   #36
RobInRockCity
Member
 
Registered: Feb 2015
Posts: 141

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
If the command ran without error, like you said it did, then the file does exist.

Run the following to see it:
Code:
ls -l /etc/ssh/ssh_host_rsa_key.pub
If you can't find it while navigating the directory structure, the only explanation is you don't understand relative vs absolute paths. Your example above shows you going to the "etc" subdirectory of your user's home directory, something like /home/vps-user/etc/, which is of course not the same place as /etc. You can always use the command "pwd" to see where you currently are.
I don't have access to /home/ because I am not root...
 
Old 02-27-2016, 06:06 PM   #37
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,561

Rep: Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127
Quote:
Originally Posted by RobInRockCity View Post
I don't have access to /home/ because I am not root...
What? Did you run something and get an error, or are you just making assumptions again about what you can/cannot do without actually trying anything? Everyone can access /home, that's where everyone's home directory is (except root, which is at /root).

1) Log into the system
2) Run "pwd"
 
Old 02-27-2016, 07:44 PM   #38
RobInRockCity
Member
 
Registered: Feb 2015
Posts: 141

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
What? Did you run something and get an error, or are you just making assumptions again about what you can/cannot do without actually trying anything? Everyone can access /home, that's where everyone's home directory is (except root, which is at /root).

1) Log into the system
2) Run "pwd"
When I ssh into the server I see this...
Code:
vps-user@mydomain.com [~]#
Then if I do this...
Code:
cd ../
I get this...
Code:
vps-user@mydomain.com [/home]#
Then if I do this...
Code:
vps-user@mydomain.com [/home]# ls
I get this...
Code:
/bin/ls: cannot open directory .: Permission denied

Which means that I am unable to navigate here to see that this exists...
Code:
ls -l /etc/ssh/ssh_host_rsa_key.pub

Yes I can run this, and yes it gives me the fingerprint, but that isn't what I asked...

I asked why I can execute something I can't navigate to.
 
Old 02-27-2016, 10:33 PM   #39
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,561

Rep: Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127
You don't have read permission for /home, but you still have execute permission which allows you to traverse the directory structure. The permissions on /home say nothing about the permissions on /etc or /etc/ssh anyway. You can't do an ls in /home, but you can still cd up to /, perhaps ls there, cd to /etc, ls there, etc.
 
Old 02-28-2016, 10:05 AM   #40
RobInRockCity
Member
 
Registered: Feb 2015
Posts: 141

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
You don't have read permission for /home, but you still have execute permission which allows you to traverse the directory structure. The permissions on /home say nothing about the permissions on /etc or /etc/ssh anyway. You can't do an ls in /home, but you can still cd up to /, perhaps ls there, cd to /etc, ls there, etc.
Hah! That worked - I was able to "hack" my way into the /etc directory.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
SSH Questions orangesky Linux - Newbie 9 01-31-2010 02:16 PM
Three SSH questions bollweevil Linux - Networking 1 03-28-2009 12:15 AM
SSH Questions Meabert Linux - Software 2 12-28-2005 02:24 AM
SSH Questions Tezdread Linux - Networking 7 02-05-2003 05:34 PM
SSH Questions Stevy123 Linux - Networking 4 10-01-2002 06:52 PM

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

All times are GMT -5. The time now is 04:02 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration