LinuxQuestions.org
Review your favorite Linux distribution.
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 05-13-2008, 11:06 PM   #1
llagunocap
LQ Newbie
 
Registered: May 2008
Posts: 16

Rep: Reputation: 0
Hostname for SSH


How do I set up or find out the hostname of my server? I want to set up SSH for my server, have IP address but I understand a hostname is required to set up SSH.

Thanks.
 
Old 05-13-2008, 11:33 PM   #2
jus71n742
Member
 
Registered: Apr 2008
Distribution: Ubuntu 8.04 64bit/ 32bit, FreeBSD 8
Posts: 185

Rep: Reputation: 30
I would guess running an ifconfig and finding out that way what your host name is then open a terminal and input yourusername@hosname like mine for the school computers is
Code:
ssh username@labpcname.cs.school.edu
 
Old 05-13-2008, 11:36 PM   #3
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 4&5, Fedora 10, CentOS 5.4, IPCop
Posts: 569

Rep: Reputation: 55
The "hostname" command will tell you the name of your server. Which distro are you running? My server's hostname isn't in any of my SSH config files, so I suspect you're heading down a wrong path

What errors are you getting when you try to SSH to your server? Is sshd running on your server?
 
Old 05-14-2008, 01:03 AM   #4
danboland
Member
 
Registered: Feb 2006
Location: NJ, USA
Distribution: Debian
Posts: 72

Rep: Reputation: 17
You don't need a hostname for ssh.

What setting are you trying to set?
 
Old 05-14-2008, 10:02 AM   #5
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 43
If you don't have a static IP(and I'm not talking about 192.168.1.x, unless you're just SSHing from the local network) I mean a static internet IP, then using the hostname to SSH into the server won't work when the internet IP changes...

There are work arounds for this but you have to tell us what you're trying to do here.
 
Old 05-15-2008, 09:30 AM   #6
llagunocap
LQ Newbie
 
Registered: May 2008
Posts: 16

Original Poster
Rep: Reputation: 0
I am new on this and starting from zero. I wanted to set up remote access to the terminal session. I am running Fedora 9.

I figured out the hostname issue and checked sshd is running in the server, thank you. I was also able to ssh from another machine within the network using both hostname and IP Address - I'll try the connection from outside the network later on.

One question, I am using SSH Secure Shell to connect from a Windows machine, how do I close or disconnect the connection from the command line?

Thank you.
 
Old 05-15-2008, 10:15 AM   #7
danboland
Member
 
Registered: Feb 2006
Location: NJ, USA
Distribution: Debian
Posts: 72

Rep: Reputation: 17
just type 'exit'. Also ctrl^d also sometimes closes different terminals (not sure if thats intended though).


a hostname or ip address is only needed in the sshd config when you want it to bind to a specific address. For instance, my server currently has two ip address assigned to it. I can make it so only one can be used for ssh. This can be very useful for security.
 
Old 05-15-2008, 12:27 PM   #8
llagunocap
LQ Newbie
 
Registered: May 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Thank you. I created user accounts using the graphical interface (System/Administration/Users and Groups). How do I grant system permission to a user accessing via ssh? I need a user to acces remotedly and install an application. Thank you again.
 
Old 05-16-2008, 12:08 AM   #9
danboland
Member
 
Registered: Feb 2006
Location: NJ, USA
Distribution: Debian
Posts: 72

Rep: Reputation: 17
Depending on what distro you are using it should be allowed by default.
If there are restrictions and the person can't connect then this setting could be in a few places. First make sure if there is a group that allows ssh that this member is a part of it. (if you can ssh, look at your group settings)

On my server, i sue this in my sshd_config:
[code]
AllowUsers user1 user1 user2 user3
AllowUsers user1, user2, user3
{/code]
 
Old 05-16-2008, 12:16 AM   #10
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Typically you'd give them tha ability to sudo, or they would su to the root account.

For the former, look at /etc/sudoers - edit it with the visudo command
 
Old 05-16-2008, 08:57 AM   #11
llagunocap
LQ Newbie
 
Registered: May 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Thank you. I looks like it is working fine now for all the users.
 
  


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 login using hostname linuxguy08 Linux - Server 4 05-01-2008 09:03 PM
can't ssh using hostname deepesh1081 Linux - Networking 1 05-06-2007 08:11 AM
can ssh by IP, can't by hostname. FLOODS Linux - Networking 7 09-19-2005 02:41 PM
Ping or SSh by hostname ElectroLinux Linux - Newbie 2 10-26-2004 04:21 AM
can't ssh through hostname romel Linux - Networking 4 07-25-2004 02:54 PM


All times are GMT -5. The time now is 05:20 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration