LinuxQuestions.org
Visit Jeremy's Blog.
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-08-2009, 11:34 PM   #1
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Rep: Reputation: 69
A few noob questions about sudo and ssh...


1. Let's say I'm running two commands that require root privs. Both commands have the suid flag and my user is on the sudoers file.

So let's say I have to run

sudo ipconfig | sudo sort

I know the two commands don't go but in this case, would I have to include sudo at the beginning of both commands or just the first one?


2. Let's say I have server running 3 different terminals and I ssh from a client computer into this server. When I do so, I open up my own terminal. How can I interact with the other 3 terminals? What command do I use from the terminal that I ssh'd into?
 
Old 02-08-2009, 11:58 PM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
I dont think you need sudo anyway either just to check the settings using ifconfig. If you need to change the settings or do some admin work then you need it.
Anyhow

sudo ifconfig | sort should just work fine.

About your second question, I could not understand it well.
What are the three terminals on your server doing? You can open as many terminals as you need and still use one ssh session to monitor every bit of your system. But you may want to put more light on your second question.
 
Old 02-09-2009, 12:05 AM   #3
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by trist007 View Post
1. Let's say I'm running two commands that require root privs. Both commands have the suid flag and my user is on the sudoers file.
That would be a very stange situation because the command(s) would (I believe) end up running as their owner regardless of what the sudoers file said.

Quote:
would I have to include sudo at the beginning of both commands or just the first one?
I think I know the answer to that, but instead of me blathering on and possibly being wrong, why don't you try it and see. If you come up with a situation you don't understand, post back and maybe somebdody can explain it to you.

Quote:
2. Let's say I have server running 3 different terminals and I ssh from a client computer into this server. When I do so, I open up my own terminal. How can I interact with the other 3 terminals? What command do I use from the terminal that I ssh'd into?
TMK you normally can't (other than sending signals to a process you own). I am not sure what you are trying to do, but you might want to look at the screen command (I am assuming you know about man pages; let me know if you don't) which I understand to have the capability of more than one user connecting to at a time ("multi user" capability. Btw, the screen man page I just looked at sometimes writes that as two words and sometimes writes it as one word.). I have never used that capability of screen but the command can be very userful for other things as well.
 
Old 02-09-2009, 03:26 AM   #4
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Rep: Reputation: 26
In question 2...do you mean...that 3 users ssh into the server through 3 terminals and you want to interect with the 3 users??
 
Old 02-09-2009, 01:34 PM   #5
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Original Poster
Rep: Reputation: 69
Let's say I have two shells open on the server computer. Each shell is running a program that is on all day. Then I ssh from a client computer into the server computer which would spawn its own shell on the server. How could I interact with the other two shells running the programs?
 
Old 02-09-2009, 07:15 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,374

Rep: Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383
As mentioned, you'd need to invoke the screen cmd on the shells that will run the progs. Then you can attach to them when you login.
 
Old 02-09-2009, 08:40 PM   #7
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Original Poster
Rep: Reputation: 69
Awesome, thanks.
 
  


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 and sudo kutty_prasad Linux - General 7 05-13-2008 03:46 AM
questions about sudo stu_mueller Slackware 5 04-04-2008 03:49 PM
commande execution with sudo(on ssh) yousmg Linux - Security 4 06-14-2007 11:04 AM
Sudo and ssh X11 fowarding Mike_the_Man Linux - General 1 05-03-2006 11:04 PM
sudo ethereal with ssh adamwenner Linux - Software 0 09-10-2004 02:21 PM

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

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