Discussion Locked

Root can not telnet on Linux 6.1 RedHat.

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi all,

As you guys know root can not telnet but we can do "su" and become as root after login with normal user account. How can it work like that?

My question is I have a user called foo and I don't want give him a telnet function to the boxbut I would like to do "su" to foo after I login(telnet) with my account. Any way or idea to try?

What I did is in /etc/passwd file, I changed foo user's /bin/bash to /etc/ftponly. The reason why I did this was it will give him a FTP function but not Telnet. After test, I couldn't login with foo but I could not do "su" to foo either. This is not what I want. I want to login with user account and do "su" to foo but becouse of /etc/ftponly in /etc/passwd file, I could become "foo".

Please let me know what else can I try.
Again, I have Linux 6.1 Redhat
Thank you in advance.

Sunny.

5 replies

by astute

/etc/securetty is used by login; the file contains tty lines on which root is allowed to login.

I am not sure how u can do this to a common user.

Good luck

by pvp

As stated, root can telnet only on a secure port.

Now, bash (sh, csh, ksh pick another shell) is a command-line-interpreter (CLI) that takes your command input and talks to the kernel.

You don't want foo to telnet, so you gave him no shell (/etc/ftponly is not a CLI), then you login'd, which starts whatever shell is in /etc/password for that user account; iow, you're in a telnet session. Then you try to su (switch user) to a user without a shell. No surprise that you can't do it. Ordinarily, a sub-level shell would be started for the su'd user. The user you picked has no shell.

If you're thinking you can login, ftp, then shell out, that's only because you started with a shell in the first place. A user coming in with an ftp session has no shell and cannot shell out.

I would strongly suggest that you find a course on Linux administration. So far you've demonstrated a very poor understanding of what's going on, and there's not enough room here to get you up to speed. At the rate you're going, you're going to render your system useless.

I'm not trying to shoot you, but these are the hard facts.

This discussion is closed to new replies.